简体   繁体   English

用于Maven SCM插件的svn-settings.xml的格式是什么?

[英]What is the format of svn-settings.xml for use with Maven SCM plugin?

I'm trying to externalize my username and password but it seems the format of svn-settings.xml is incorrect. 我正在尝试外部化我的用户名和密码,但似乎svn-settings.xml的格式不正确。 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 在我的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 I got 在C:\\ Documents and Settings \\ my_uid.scm \\ svn-settings.xml中我得到了

<svn-settings>
   <user>my_uid</user>
   <password>my_pwd</password>
 </svn-settings>

When I run Maven it fails with these messages: 当我运行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)

So, what should I use instead of 那么,我应该用什么而不是 ?

According to the maven SCM integration documentation it seems that the svn-settings.xml file only allows these parameters: 根据maven SCM集成文档 ,似乎svn-settings.xml文件只允许这些参数:

  • configDirectory configDirectory
  • useCygwinPath useCygwinPath
  • cygwinMountPath cygwinMountPath
  • useNonInteractive useNonInteractive

If you do not want to put the password in the pom.xml you can pass it as a command line parameter 如果您不想将密码放在pom.xml中,可以将其作为命令行参数传递

in the pom.xml: 在pom.xml中:

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

And when invoking maven: 在调用maven时:

mvn -Dpassword=my_password scm:status

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM