问题
I want to perform a mvn release in batch mode and without having to enter the password.
This is my configuration:
pom.xml
...
<properties>
<project.scm.id>my-scm-server</project.scm.id>
</properties>
<scm>
<developerConnection>scm:git:ssh://jenkins@192.168.10.10/repos/git/myrepo.git</developerConnection>
<tag>HEAD</tag>
</scm>
...
settings.xml
<servers>
<server>
<id>my-scm-server</id>
<username>root</username>
<privateKey>/jenkins/.ssh/id_rsa</privateKey>
<passphrase>rootpwd</passphrase>
</server>
<servers>
Shell command:
mvn -B
-s /jenkins/settings.xml
-U -e -Pmy-profile -Duser=jenkins -Dpassword=jenkins
release:prepare
When I launch the command, after some maven work during the workflow, I am asked for jenkins user password:
root:jenkins@192.168.10.10's password:
I want to avoid this behavior, and let the release to get automatically the required password.
What I have to do, what I am doing wrong in this configuration?
I found a similar post Maven release plugin git credentials
But that solution don't work for me. Accessing with root, during the workflow I was asked of jenkins user pwd.
Thanks a lot
来源:https://stackoverflow.com/questions/56846800/mvn-releaseprepare-and-perform-in-batch-without-password-typing