Why am I getting a \"401 Unauthorized\" error in Maven?
Here\'s the error I\'m getting when calling mvn deploy (full logs at the bottom):
I was dealing with this running Artifactory version 5.8.4. The "Set Me Up" function would generate settings.xml as follows:
${security.getCurrentUsername()}
${security.getEscapedEncryptedPassword()!"AP56eMPz8L12T5u4J6rWdqWqyhQ"}
central
${security.getCurrentUsername()}
${security.getEscapedEncryptedPassword()!"AP56eMPz8L12T5u4J6rWdqWqyhQ"}
snapshots
After using the mvn deploy -e -X switch, I noticed the credentials were not accurate. I removed the ${security.getCurrentUsername()} and replaced it with my username and removed ${security.getEscapedEncryptedPassword()!""} and just put my encrypted password which worked for me:
username
AP56eMPz8L12T5u4J6rWdqWqyhQ
central
username
AP56eMPz8L12T5u4J6rWdqWqyhQ
snapshots
Hope this helps!