Mvn release:prepare and perform in batch without password typing

末鹿安然 提交于 2019-12-13 20:16:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!