与 Maven SCM 插件一起使用的 svn-settings.xml 的格式是什么?
我正在尝试外部化我的用户名和密码,但 svn-settings.xml 的格式似乎不正确。除了这篇文章此处以及下面的内容之外,我在网络上找不到任何资源一个错误。
在我的 pom.xml 中,我得到了
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
...
<configuration>
<connectionUrl>scm:svn:http://my_hostname/im-tools-repos/trunk</connectionUrl>
<checkoutDirectory>${project.build.directory}/checkout/im-tools</checkoutDirectory>
</configuration>
</execution>
</executions>
</plugin>
In C:\Documents and Settings\my_uid.scm\svn-settings.xml
<svn-settings>
<user>my_uid</user>
<password>my_pwd</password>
</svn-settings>
当我运行 Maven 时,它失败并显示以下消息:
C:\Documents and Settings\my_uid\.scm\svn-settings.xml isn't well formed. SKIPPED.Unrecognised tag: 'user' (position: START_TAG seen <svn-settings>\r\n\t<user>... @2:7)
[INFO] Executing: cmd.exe /X /C "svn --non-interactive checkout http://my_hostname/im-tools-repos/trunk C:\test\bamboo\agent\target\checkout\im-tools"
[INFO] Working directory: C:\test\bamboo\agent\target\checkout
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: OPTIONS of 'http://my_hostname/im-tools-repos/trunk': authorization failed: Could not authenticate to server: rejected Basic challenge (http://my_hostname)
那么,我应该使用什么来代替 ?
I'm trying to externalize my username and password but it seems the format of svn-settings.xml is incorrect. I can't find any resources on the web except this post here and following that gives an error.
In my pom.xml I got
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
...
<configuration>
<connectionUrl>scm:svn:http://my_hostname/im-tools-repos/trunk</connectionUrl>
<checkoutDirectory>${project.build.directory}/checkout/im-tools</checkoutDirectory>
</configuration>
</execution>
</executions>
</plugin>
In C:\Documents and Settings\my_uid.scm\svn-settings.xml I got
<svn-settings>
<user>my_uid</user>
<password>my_pwd</password>
</svn-settings>
When I run Maven it fails with these messages:
C:\Documents and Settings\my_uid\.scm\svn-settings.xml isn't well formed. SKIPPED.Unrecognised tag: 'user' (position: START_TAG seen <svn-settings>\r\n\t<user>... @2:7)
[INFO] Executing: cmd.exe /X /C "svn --non-interactive checkout http://my_hostname/im-tools-repos/trunk C:\test\bamboo\agent\target\checkout\im-tools"
[INFO] Working directory: C:\test\bamboo\agent\target\checkout
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: OPTIONS of 'http://my_hostname/im-tools-repos/trunk': authorization failed: Could not authenticate to server: rejected Basic challenge (http://my_hostname)
So, what should I use instead of ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据maven SCM集成文档 似乎 svn-settings.xml 文件只允许这些参数:
如果您不想将密码放在 pom.xml 中,您可以 命令行参数传递
将其作为pom.xml 中的
:调用 maven 时:
According to the maven SCM integration documentation it seems that the svn-settings.xml file only allows these parameters:
If you do not want to put the password in the pom.xml you can pass it as a command line parameter
in the pom.xml:
And when invoking maven: