我想在eclipse中使用SVNAnt。但是当我运行我的脚本时,我会看到这样的消息:
Buildfile: X:\XXX\bin\ant\axis_bujava.xml
[typedef] Could not load definitions from resource org/tigris/subversion/svnant/svnantlib.xml. It could not be found.
testSVNAnt:
BUILD FAILED
X:\XXX\bin\ant\axis_bujava.xml:11: Problem: failed to create task or type svn
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.以下是Ant构建文件:
<?xml version="1.0"?>
<project default="testSVNAnt" basedir=".">
<path id="path.svnant">
<pathelement location="${basedir}/svnant.jar"/>
<pathelement location="${basedir}/svnClientAdapter.jar"/>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="path.svnant" />
<target name="testSVNAnt">
<svn username="username" password="pass">
<checkout url="svn://svnurl" destPath="localpath" revision="HEAD"/>
</svn>
<echo message= "Subversion repository url: ${repository.url}" />
</target>
</project>当然,JAR文件在basedir中。我找不到类似的问题也找不到任何解决方案。
发布于 2011-11-16 18:17:30
它最终使用了SvnAnt 1.3.1。
使用以下代码可以很好地执行签出操作:
<?xml version="1.0"?>
<project default="main" basedir=".">
<path id="path.svnant">
<pathelement location="${basedir}/svnant.jar" />
<pathelement location="${basedir}/svnClientAdapter.jar" />
<pathelement location="${basedir}/svnjavahl.jar" />
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="path.svnant" />
<target name="main">
<svn>
<checkout url="svn://xxx" destPath="X:/XXX" revision="HEAD" />
</svn>
</target>
</project>谢谢你的帮助。
发布于 2011-11-15 23:45:18
你必须使用
<taskdef />代替<typedef/>
其他的看起来都很好。
发布于 2013-10-28 20:01:42
也有同样的问题。将"resource“的值从"org/tigris/subversion/svnant/svnantlib.xml”替换为"svntask.properties“。
示例如下:(svn_1.0.0;eclipse juno)
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="D:/.../ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<path id="path.svnant">
<pathelement location="D:/.../lib/svnant.jar" />
<pathelement location="D:/.../lib/svnClientAdapter.jar" />
<pathelement location="D:/.../lib/svnjavahl.jar" />
</path>
<typedef **resource="svntask.properties"** classpathref="path.svnant"/>
<target name="ifAvailable">
<available classpathref="path.svnant" **resource="svntask.properties"**
property="temp"/>
<echo message="SVNAnt is available = ${temp}"></echo>
</target>OUTPUT>>>>>
Buildfile: D:\...\build.xmlifAvailable: echo SVNAnt is available = true构建成功总时间: 306毫秒
https://stackoverflow.com/questions/8138807
复制相似问题