[英]Maven release plugin not using configured username
I am using maven-release-plugin:2.5.1. 我正在使用maven-release-plugin:2.5.1。 I need to configure it to connect to SVN using public/private key authentication.
我需要配置它以使用公钥/私钥身份验证连接到SVN。 I'm having problems getting the configuration to use the correct username when attempting the SSH connection to SVN.
尝试通过SSH连接到SVN时,我在配置中使用正确的用户名时遇到问题。
My deploy-settings.xml <server>
config looks like: 我的deploy-settings.xml
<server>
配置看起来像:
<server>
<id>my.server.org</id>
<username>[XXXX]</username>
<privateKey>/home/[YYYY]/.ssh/id_rsa</privateKey>
</server>
My pom.xml <scm>
config looks like: 我的pom.xml
<scm>
配置看起来像:
scm:svn:svn+ssh://my.server.org/data1/svns_zzzz/zzzz/path/to/the/project/trunk
My mvn
command line looks like: 我的
mvn
命令行如下所示:
--batch-mode release:clean release:prepare release:perform
-s /home/[YYYY]/.m2/deploy-settings.xml
-Dsettings.security=/home/[YYYY]/.m2/master-settings.xml
When I tried the above configuration it failed. 当我尝试上述配置时,它失败了。 It could not commit the modified POM file to SVN.
无法将修改后的POM文件提交给SVN。 To help debug this problem, I set the following environment variable:
为了帮助调试此问题,我设置了以下环境变量:
SVN_SSH="ssh -vvv"
When I did this, I saw in the debug statements too many authentication failures with a username other than the [XXXX]
username defined in the <server>
tag. 当我这样做时,我在调试语句中看到使用
<server>
标记中定义的[XXXX]
用户名以外的用户名的身份验证失败过多。
So then I tried to specify the username in the command line: 因此,我尝试在命令行中指定用户名:
--batch-mode -Dusername=[XXXX] release:clean release:prepare release:perform...
That didn't work. 那没用。
So then I tried to specify the username in the POM: 因此,然后我尝试在POM中指定用户名:
scm:svn:svn+ssh://[XXXX]@my.server.org/data1/svns_zzzz/zzzz/path/to/the/project/trunk
That didn't work either. 那也不起作用。
To debug and verify my [XXXX]
username and /home/[YYYY]/.ssh/id_rsa
key did in fact work, I added them to the environment variable: 要调试并验证我的
[XXXX]
用户名和/home/[YYYY]/.ssh/id_rsa
键确实起作用,我将它们添加到了环境变量中:
SVN_SSH="ssh -vvv -l [XXXX] -i /home/[YYYY]/.ssh/id_rsa"
After setting the environment variable like this, it worked. 像这样设置环境变量后,它就起作用了。 The release plugin was able to successfully commit the modified POM file to SVN.
该发行插件能够将修改后的POM文件成功提交到SVN。 So I know the username and password work.
因此,我知道用户名和密码有效。
So now the question is what is wrong with my Maven configuration? 所以现在的问题是我的Maven配置出了什么问题? Setting the SVN_SSH environment variable helped diagnose the problem, and provides a work-around but I don't want to leave it as a long-term solution.
设置SVN_SSH环境变量有助于诊断问题,并提供了一种解决方法,但我不想将其作为长期解决方案。
Any thoughts? 有什么想法吗?
The release plugin forks the build, and doesn't pass the arguments you provide on the command line to the forked process by default. 发行插件会分叉构建,并且默认情况下不会将您在命令行上提供的参数传递给派生进程。 Try adding this:
-Darguments="-s /home/[YYYY]/.m2/deploy-settings.xml -Dsettings.security=/home/[YYYY]/.m2/master-settings.xml"
(note double quotes) to the current command line. 尝试添加以下内容:
-Darguments="-s /home/[YYYY]/.m2/deploy-settings.xml -Dsettings.security=/home/[YYYY]/.m2/master-settings.xml"
(请注意双引号)到当前命令行。 This should pass the changes to the forked processes. 这应将更改传递给分叉的过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.