3

ユーザー名とパスワードを外部化しようとしていますが、svn-settings.xmlの形式が正しくないようです。この投稿とそれに続くエラーを除いて、Web上でリソースを見つけることができません

私の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 and 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)

だから、私は代わりに何を使うべきですか

4

1 に答える 1

7

Maven SCM 統合ドキュメントによると、svn-settings.xml ファイルでは次のパラメーターのみが許可されているようです。

  • 構成ディレクトリ
  • useCygwinPath
  • cygwinマウントパス
  • useNonInteractive

pom.xml にパスワードを入れたくない場合は、コマンド ライン パラメータとして渡すことができます。

pom.xml で:

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

そしてmavenを呼び出すとき:

mvn -Dpassword=my_password scm:status
于 2010-09-01T14:20:02.157 に答える