Skip to main content

Maven Settings Profile Switcher

Project description

MSPS - Maven Settings Profile Switcher

PyPI - Version PyPI - Python Version PyPI - License Sonar Coverage Sonar Quality Gate

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

The problem

Profiles let you set up repositories or servers for each project or environment, streamlining your workflow and keeping your workspace clean. You can set up different settings for personal coding, testing new tools, and work. However, there are a few settings, like mirror configurations, that can't be tucked away in profiles.

This means if you need to switch between a private mirror in one environment and the Maven Central in another, you'll need to make those adjustments directly in the settings.xml file itself, or you might need to replace the entire file. This can be cumbersome, especially when managing many profiles and switching between them frequently.

:hammer: Requirements

  • Python 3.13 or later

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

:floppy_disk: Installation

pip install msps

:gear: 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

:wrench: 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.

:man_mechanic: 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.4.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msps-1.0.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file msps-1.0.4.tar.gz.

File metadata

  • Download URL: msps-1.0.4.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for msps-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7ae762462ecf6e3d858a3e60899d376f41aae7e07d31058baf4287be61595a81
MD5 609e921d30c4f568c0bfdef621715bb0
BLAKE2b-256 83629aebebd96c0fefab0bfd63ccd5a9b253aac909005543ae1aad867a50b8e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for msps-1.0.4.tar.gz:

Publisher: release-prod.yaml on tyutyutyu/msps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file msps-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: msps-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for msps-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 110b3d2f1dad197d988ab1fc35972ebf8f14fdad90322a1c33c8dbc191a1ba3a
MD5 0e0a7f5f6f993962f117af1c4c9f48d5
BLAKE2b-256 eb2eee816b8cd3bb6e678d3a36f47625e376d5a3c5df94694ddc4ba20b708623

See more details on using hashes here.

Provenance

The following attestation bundles were made for msps-1.0.4-py3-none-any.whl:

Publisher: release-prod.yaml on tyutyutyu/msps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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