Issue
This is the way it currently works, and it's the Maven Deploy Plugin Usage
pom.xml
[...]
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>MyCo Internal Repository</name>
<url>Host to Company Repository</url>
</repository>
</distributionManagement>
[...]
settings.xml
[...]
<server>
<id>internal.repo</id>
<username>someUser</username>
<password>somePassword</password>
</server>
[...]
and what I'm trying to achieve is finding a way in which the username and password are typed in at the command line. to achieve mvn deploy -someUser -somePassword
Solution
The settings.xml
is considered personal, so for that reason the username+password are stored in the (user-)settings.xml
. So in general there's no reason to pass them as argument. (btw, passwords can be stored encrypted here) The maven-deploy-plugin
has no option to pass them via commandline. However, I've seen hacks like:
<username>${internal.repo.username}</username>
And now you can do -Dinternal.repo.username=someUser
Answered By - Robert Scholte