与Maven SCM插件一起使用的svn-settings.xml的格式是什么? [英] What is the format of svn-settings.xml for use with Maven SCM plugin?

查看:191
本文介绍了与Maven SCM插件一起使用的svn-settings.xml的格式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试外部化用户名和密码,但是 svn-settings.xml 的格式似乎不正确.除了这篇文章此处,然后在此之后,我在网上找不到任何资源.一个错误.

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.

在我的pom.xml中,

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>

在C:\ Documents and Settings \ my_uid.scm \ svn-settings.xml中

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>

当我运行Maven时,失败并显示以下消息:

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 ?

推荐答案

根据Maven SCM集成

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

  • configDirectory
  • useCygwinPath
  • cygwinMountPath
  • useNonInteractive

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

If you do not want to put the password in the pom.xml you can pass it as a command line parameter

在pom.xml中:

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

在调用Maven时:

mvn -Dpassword=my_password scm:status

这篇关于与Maven SCM插件一起使用的svn-settings.xml的格式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆