2010-09-01 44 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