What is the format of svn-settings.xml for use with Maven SCM plugin?
Asked Answered
S

1

3

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 ?

Sturmabteilung answered 1/9, 2010 at 13:9 Comment(0)
A
7

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
Amadou answered 1/9, 2010 at 14:20 Comment(3)
You're correct. This means that the answer to the question I linked was wrong after all.Sturmabteilung
is this variable name password correct? Is that the default name that the scm plugins uses? I try to set my svn auth information via command line right now.Assessment
Yes, username and password are used to set the user credentials. You can found the scm plugins parameters here: maven.apache.org/scm/plugins/list-mojo.htmlAmadou

© 2022 - 2024 — McMap. All rights reserved.