3

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.

Community
  • 1
  • 1
George
  • 4,029
  • 2
  • 22
  • 26

1 Answers1

2

settings.xml, server section

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

id must correlate to connection in scm section

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • 1
    Can you explain why the same settings.xml works on Windows 7 but Ubuntu doesn't? Anyway i tried my.svn.host.com:80 and my.svn.host.com as the id value, just verified that they don't work for me. – George Apr 01 '12 at 12:04
  • @George - in Windows you *may have* credentials cached. Author of ticket confirmed it works in hit configuration (and I don't know where yours differ). Port is useless for default values – Lazy Badger Apr 01 '12 at 12:24
  • 1
    I tried with/without port number,none of the two works for me. I want to know where is the cached svn user credentials be saved and what's the relation between the cached user credentials and the maven plugin? How the plugin use the cached user credentials saved by other application? – George Apr 01 '12 at 12:31