2010-09-01 61 views
3

我试图外化我的用户名和密码,但它似乎格式为svn-settings.xml不正确。我在网上找不到任何资源,除了这篇文章here以及后面给出的错误。用于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> 

在C:\ Documents和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) 

所以,我应该怎么用的,而不是

回答

7

据行家SCM集成documentation似乎SVN-settings.xml文件只允许这些参数:

  • configDirectory
  • useCygwinPath
  • cygwinMountPath
  • useNonInteractive

如果你不想把密码放在你的pom.xml中调用行家当

<connectionUrl>scm:svn:http://[email protected]_hostname/im-tools-repos/trunk</connectionUrl> 

而且:可以将它作为命令行参数

在pom.xml

mvn -Dpassword=my_password scm:status 
+0

你是正确的。这意味着我所链接的问题的答案毕竟是错误的。 – Koohoolinn 2010-09-08 11:33:51

+0

这个变量名是否正确?这是scm插件使用的默认名称吗?我尝试通过命令行设置我的svn auth信息。 – cringe 2011-04-21 06:36:10

+0

是的,用户名和密码用于设置用户凭证。你可以在这里找到scm插件参数:http://maven.apache.org/scm/plugins/list-mojo.html – Jcs 2011-04-21 09:10:37