我使用buildnumber-maven-plugin,我需要从svn获取项目的版本号。我的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>但是,当我打包一个项目时,我有错误:
[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}).虽然我使用TortoiseSVN 1.8.2!
我看到buildnumber-maven-plugin在TortoiseSVN 1.7和更高版本中的行为是这样的。如何使用SVN和Maven获取生成号?
发布于 2014-03-27 15:38:58
内置插件将访问您的工作副本以获得修订版,并且由于您使用的是TortoiseSVN 1.8.x,所以您的工作副本是SVN1.8.x格式。因此,内置插件使用的svnkit也需要支持SVN1.8.x,而您使用的版本(1.7.4-v1)很可能不支持SVN1.8.x。
因此,您需要更新版本的svnkit。
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.3-1</version>
</dependency>https://stackoverflow.com/questions/22692238
复制相似问题