5

I use buildnumber-maven-plugin and I need take build number of project from svn. My pom.xml:

<scm>
    <connection>
        scm:svn:https://username:password@path_to_repositiry
    </connection>
</scm>

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.1</version>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <doCheck>false</doCheck>
        <doUpdate>false</doUpdate>
        <providerImplementations>
            <svn>javasvn</svn>
        </providerImplementations>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
            <artifactId>maven-scm-provider-svnjava</artifactId>
            <version>2.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.tmatesoft.svnkit</groupId>
            <artifactId>svnkit</artifactId>
            <version>1.7.4-v1</version>
        </dependency>
    </dependencies>
</plugin>

But I have error, when I package a project:

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.1:create (default)on project myproject: Cannot get the revision information from the scm repository : [ERROR] Exception while executing SCM command. svn: E155021: This client is too old to work with the working copy at [ERROR] 'D:\projects\myproject' (format {1}).

Although I use TortoiseSVN 1.8.2!

I read that buildnumber-maven-plugin behaves so with TortoiseSVN 1.7 and older. How can I take build number using SVN and Maven?

Juliano Alves
  • 2,006
  • 4
  • 35
  • 37
RuF
  • 548
  • 1
  • 11
  • 31

1 Answers1

7

The buildnumber plugin will access your working copy to get the revision and since you use TortoiseSVN 1.8.x your working copy is in svn 1.8.x format. Hence svnkit which is used by the buildnumber plugin needs to support svn 1.8.x as well, which the version you're using (1.7.4-v1) most probably doesn't.

You thus need a newer version of svnkit, e.g.

<dependency>
  <groupId>org.tmatesoft.svnkit</groupId>
  <artifactId>svnkit</artifactId>
  <version>1.8.3-1</version>
</dependency>
Thomas
  • 87,414
  • 12
  • 119
  • 157
  • 3
    Also, there's a newer version of the buildnumber-maven-plugin available: Version 1.2. Make sure both the svnkit and buildnumber-maven-plugin versions are up-to-date. – Chad Nouis Mar 27 '14 at 15:43
  • @user3186861 feel free to accept the answer then ;) – Thomas Mar 27 '14 at 15:53
  • Adding some extra information, I was using a framework where this dependency was stated correctly, but my Parent POM was overriding it without this dependency (started with ` org.codehaus.mojo`...) so it didn't find the correct verison, when I expanded with Thomas' dependency it worked fine. – CsBalazsHungary Sep 03 '15 at 08:17