Created
May 4, 2017 03:14
-
-
Save amgohan/fc0428071985cfbcf6b2988e9c9a9143 to your computer and use it in GitHub Desktop.
switch maven settings.xml by profile (home, work) for example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
PROFILE=$1 | |
SETTINGS_FILE=~/.m2/settings.xml.${PROFILE} | |
if [ -a ${SETTINGS_FILE} ] | |
then | |
cp -f ~/.m2/settings.xml.${PROFILE} ~/.m2/settings.xml | |
echo "Profile [$1] activated [~/.m2/settings.xml]" | |
else | |
echo "File not found [${SETTINGS_FILE}]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to install
How to use
suppose you have 2 settings.xml one for your work and the other for your own projects at home
~/.m2/settings.xml.home
and~/.m2/settings.xml.work
you can switch between them by using