Skip to main content

Maven Settings Profile Switcher

Project description

MSPS - Maven Settings Profile Switcher

PyPI - Version PyPI - Python Version PyPI - License

MSPS is a user-friendly tool that simplifies switching between various Maven settings profiles.

Requirements

  • Python 3.10 or later

[!NOTE] Developed and tested on Linux (Ubuntu); may also work on macOS.

Installation

pip install msps

Configuration

Maven settings profiles

The tool expects the Maven settings profiles to be stored in the Maven home directory.

MSPS first checks the M2_HOME environment variable to identify the Maven home directory. If this variable is not set, it searches for the .m2 directory within the user's home directory.

The profiles should be named in the following format:

settings__profile_name.xml

Usage

msps <command> [profile]

Commands

  • switch - Switch to the next available profile or the specified profile.
  • list - List available profiles.

Profile

  • The name of the profile to switch to.

Examples

Unspecified profile switch

The tool will automatically switch to the next available profile.

msps switch
╭──────────── Maven Settings Profile Switcher ────────────╮
│                                                         │
│  Profile changed from current_profile to next_profile.  │
│                                                         │
╰─────────────────────────────────────────────────────────╯

Switch to profile

The specified profile will be activated.

msps switch work
╭───────────── Maven Settings Profile Switcher ──────────────╮
│                                                            │
│  M2_HOME: /home/testuser/.m2/                              │
│  Available settings profiles:                              │
│    - personal (/home/testuser/.m2/settings__personal.xml)  │
│    - work (/home/testuser/.m2/settings__work.xml)          │
│  Profile changed from personal to work.            │
│                                                            │
╰────────────────────────────────────────────────────────────╯

Switch to non-existent profile

No changes will be made if the specified profile is not found.

msps switch target_profile
╭───────────── Maven Settings Profile Switcher ──────────────╮
│                                                            │
│  Missing profile: target_profile                           │
│                                                            │
│  M2_HOME: /home/testuser/.m2/                              │
│  Available settings profiles:                              │
│    - personal (/home/testuser/.m2/settings__personal.xml)  │
│    - work (/home/testuser/.m2/settings__work.xml)          │
│  No changes were made.                                     │
│                                                            │
╰────────────────────────────────────────────────────────────╯

List available profiles

msps list
╭───────────── Maven Settings Profile Switcher ──────────────╮
│                                                            │
│  Available settings profiles:                              │
│    - personal (/home/testuser/.m2/settings__personal.xml)  │
│    - work (/home/testuser/.m2/settings__work.xml)          │
│                                                            │
╰────────────────────────────────────────────────────────────╯

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msps-1.0.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

msps-1.0.1-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page