What is the format of svn-settings.xml for use wit

2020-03-05 02:34发布

I'm trying to externalize my username and password but it seems the format of svn-settings.xml is incorrect. 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

<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

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

When I run Maven it fails with these messages:

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 ?

1条回答
萌系小妹纸
2楼-- · 2020-03-05 03:30

According to the maven SCM integration documentation it seems that the svn-settings.xml file only allows these parameters:

  • configDirectory
  • useCygwinPath
  • cygwinMountPath
  • useNonInteractive

If you do not want to put the password in the pom.xml you can pass it as a command line parameter

in the pom.xml:

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

And when invoking maven:

mvn -Dpassword=my_password scm:status
查看更多
登录 后发表回答