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

Koo*_*inn 3 svn maven-2 maven-scm

我正在尝试外部化我的用户名和密码,但似乎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>
Run Code Online (Sandbox Code Playgroud)

在C:\ Documents and Settings\my_uid.scm\svn-settings.xml中我得到了

<svn-settings>
   <user>my_uid</user>
   <password>my_pwd</password>
 </svn-settings>
Run Code Online (Sandbox Code Playgroud)

当我运行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)
Run Code Online (Sandbox Code Playgroud)

那么,我应该用什么而不是

Jcs*_*Jcs 7

根据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>
Run Code Online (Sandbox Code Playgroud)

在调用maven时:

mvn -Dpassword=my_password scm:status
Run Code Online (Sandbox Code Playgroud)