我最近将我的系统从 Mint12 升级到了 Mint14,并且在让我的旧项目在新系统上很好地工作方面遇到了严重的问题。总结一下:
- 让 Mint14 运行良好并安装了我所有的基本软件(Eclipse、ANT 等)
- 从我的备份磁盘恢复我的文件
- 将 Oracle JDK 设置为默认 java 版本
- 从 SVN 签出我的项目的新副本
- 更新了构建文件中的所有路径以反映新的 user_id
这一切都很好,但是我的 ant 构建似乎已经搞砸了,不知何故,当我尝试构建我的项目时,我收到以下错误:
~/new_workspace/my_project $ ant dist
Buildfile: /home/my_userid/new_workspace/my_project/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
init:
compile:
[javac] /home/my_userid/new_workspace/my_project/build.xml:246: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
static:
dist:
[svn] <Status> started ...
[svn] svn: This client is too old to work with working copy '/home/my_userid/new_workspace/my_project'; please get a newer Subversion client
[svn] svn: This client is too old to work with working copy '/home/my_userid/new_workspace/my_project'; please get a newer Subversion client
[svn] <Status> failed !
BUILD FAILED
/home/my_userid/new_workspace/my_project/build.xml:104: Can't get status of /home/my_userid/new_workspace/my_project
Total time: 0 seconds
我注意到“太旧而无法使用工作副本......”但是当我检查时svn --version
我发现它是 1.7.5 应该没问题。注意服务器上的SVN版本同时没有改变。一个理论是该项目(通过 Eclipse 签出,使用 Subclipse 1.6)不适用于 ANT 通过命令行使用的版本,但在这种情况下,客户端版本不是太旧,而是太新!?是否值得“降级”Subversion?
否则可能是什么问题,我该如何解决?是否还有其他常见问题(可能在发行版升级/迁移期间发生)我应该检查以确保项目正常运行?(以下是构建文件的相关位)
该位定义了 svn 绑定
<path id="svnant.classpath">
<fileset dir="/home/my_userid/.ant/lib">
<include name="svnant.jar" />
<include name="svnClientAdapter.jar" />
<include name="svnjavahl.jar" />
<!-- <include name="svnkit.jar" /> tried this as well but no joy -->
</fileset>
</path>
“dist”目标中的相关位:
<target name="dist"
depends="compile,static" description="Compiles and builds jar files">
<mkdir dir="${dist}"/>
<buildnumber file="project-version.properties"/>
<property name="version.number" value="${major.version}.${minor.version}.${micro.version}"/>
<svn>
<status path="."
lastChangedRevisionProperty="rev.number" />
<info target="." />
</svn>
...