Java – buildnumber-maven-plugin got svn: Authentication required for ‘Subversion Repository’ error

authenticationbuildnumber-maven-pluginjavamavensvn

buildnumber-maven-plugin cannot check the latest revision number of the svn code base.
pom config

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <doCheck>false</doCheck>
        <doUpdate>true</doUpdate>
        <providerImplementations>
            <svn>javasvn</svn>
        </providerImplementations>
    </configuration>
</plugin>

when i run mvn compile on Ubuntu 11.10 i got error message as following

[INFO] --- buildnumber-maven-plugin:1.0:create (default) @ some-module ---
[INFO] Change the default 'svn' provider implementation to 'javasvn'.
[INFO] Checking for local modifications: skipped.
[INFO] SVN update directory: /path/to/my/project/some-module
[ERROR] Provider message:
[ERROR] SVN update failed.
[ERROR] Command output:
[ERROR] svn: Authentication required for '<http://my.svn.host.com:80> Subversion Repository'

at the same time, the svn up works fine.

But i run the same command on Window 7, this plugin can get the revision number and the error message do not show up and i use TortoiseSVN can also update the module.

So there MUST has a default config for maven-scm-provider-svnjava plugin to get the username and password for the subversion repository? Where is it? How to configure this?

I already tried mvn compile -Dusername=xxx -Dpassword=yyy, it works but the username and password parameters conflicts with my database configs. BTW, settings.xml file in the .m2 directory only has Maven Repository configs.

I user java 1.6.0-31, maven 3.0.4, TortoiseSvn 1.6.16, svn 1.6.12 on Ubuntu 11.10.

Update
Turn out that the answers is related to this question: SVN won't cache credentials, problem solved.

Best Answer

settings.xml, server section

<server>
  <id>...</id>
  <username>..</username>
  <password>..</password>
</server>

id must correlate to connection in scm section

Related Topic