我正在尝试将 jgitflow 插件用于 maven 并通过 Jenkins 管道运行版本。
插件配置:
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1</version>
<configuration>
<username>${git.user}</username>
<password>${git.password}</password>
<enableSshAgent>true</enableSshAgent>
<autoVersionSubmodules>true</autoVersionSubmodules>
<noDeploy>true</noDeploy>
<releaseBranchVersionSuffix>-RELEASE</releaseBranchVersionSuffix>
</configuration>
</plugin>
问题是当我传递 jgitflow 的凭据时。
withCredentials([usernamePassword(credentialsId: 'my_credentials_id', passwordVariable: 'USERNAME', usernameVariable: 'PASSWORD')]) {
sh "git checkout develop"
sh "mvn -f jgitflow:release-start -B -U -DskipTests -DnoDeploy=true -DpushReleases=false -Dgit.user=$USERNAME -Dgit.password=$PASSWORD"
sh "mvn -f jgitflow:release-finish -B -U -Dmaven.javadoc.skip=true -DskipTests -DnoDeploy=true -DpushReleases=true -Dgit.user=$USERNAME -Dgit.password=$PASSWORD"
}
上面的设置不起作用,但如果我明确传递用户名和密码而不是变量,一切都很好。我用错了吗?