解决 svn: E155021: This client is too old to work with the working copy

来源:互联网 发布:朴宰范和2pm知乎 编辑:程序博客网 时间:2024/06/04 19:34

这个错误是在使用maven插件maven-svn-revision-number-plugin获取SVN版本号时引起的。

pom.xml原配置如下:

<plugin><groupId>com.google.code.maven-svn-revision-number-plugin</groupId><artifactId>maven-svn-revision-number-plugin</artifactId><version>1.6</version><configuration><verbose>true</verbose><entries><entry><prefix>SVN</prefix><depth>empty</depth></entry></entries></configuration><executions><execution><phase>validate</phase><goals><goal>revision</goal></goals></execution></executions><dependencies><dependency><groupId>org.tmatesoft.svnkit</groupId><artifactId>svnkit</artifactId><version>1.7.8</version></dependency></dependencies></plugin>

当本地安装的SVN版本为1.8或大于1.6时,打包时就会出现错误:

svn: E155021: This client is too old to work with the working copy


解决方法:升级插件版本以及依赖SVN的版本

原插件maven-svn-revision-number-plugin已经升级为svn-revision-number-maven-plugin,配置版本为1.13,依赖的svnkit版本设置为1.8.5,这样既能支持低SVN版本1.6的也能支持1.8的了。

pom.xml完整的配置如下

<plugin><groupId>com.google.code.maven-svn-revision-number-plugin</groupId><artifactId>svn-revision-number-maven-plugin</artifactId><version>1.13</version><configuration><verbose>true</verbose><entries><entry><prefix>SVN</prefix><depth>empty</depth></entry></entries></configuration><executions><execution><phase>validate</phase><goals><goal>revision</goal></goals></execution></executions><dependencies><dependency><groupId>org.tmatesoft.svnkit</groupId><artifactId>svnkit</artifactId><version>1.8.5</version></dependency></dependencies></plugin>

如上配置后pom.xml后可能会报错:

Plugin execution not covered by lifecycle configuration: com.google.code.maven-svn-revision-
 number-plugin:svn-revision-number-maven-plugin:1.13:revision (execution: default, phase: 
 validate)


可以忽略它,执行打包命令的的时候,添加忽略选项:-Dsvn-revision-number.failOnError=false。

完整的打包命令如:mvn clean package -Dsvn-revision-number.failOnError=false,Eclipse配置相似。


至此问题解决!


0 0
原创粉丝点击