与 Maven SCM 插件一起使用的 svn-settings.xml 的格式是什么?

发布于 2024-09-17 05:10:52 字数 1827 浏览 4 评论 0原文

我正在尝试外部化我的用户名和密码,但 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故人的歌 2024-09-24 05:10:52

根据maven SCM集成文档 似乎 svn-settings.xml 文件只允许这些参数:

  • configDirectory
  • useCygwinPath
  • cygwinMountPath
  • useNonInteractive

如果您不想将密码放在 pom.xml 中,您可以 命令行参数传递

将其作为pom.xml 中的

<connectionUrl>scm:svn:http://my_username@my_hostname/im-tools-repos/trunk</connectionUrl>

:调用 maven 时:

mvn -Dpassword=my_password scm:status

According to the maven SCM integration documentation it seems that the svn-settings.xml file only allows these parameters:

  • configDirectory
  • useCygwinPath
  • cygwinMountPath
  • useNonInteractive

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:

<connectionUrl>scm:svn:http://my_username@my_hostname/im-tools-repos/trunk</connectionUrl>

And when invoking maven:

mvn -Dpassword=my_password scm:status
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文