Created
December 4, 2012 01:22
-
-
Save GoSteven/4199666 to your computer and use it in GitHub Desktop.
Change maven encripted password in ~/.m2/settings.xml
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 | |
echo Please type your password: | |
read -s p | |
encrypted=`mvn --encrypt-password $p` | |
echo encrypted password for mvn is: | |
echo $encrypted | |
#escape / | |
encrypted=`echo "$encrypted" | sed s,/,\\\\\\\\\\/,g` | |
echo $encrypted | |
cd ~/.m2/ | |
cp settings.xml{,_bak} | |
cat settings.xml_bak | sed s/{.*}/$encrypted/g > settings.xml | |
p='dummy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment