在eclipse中使用SVNAnt构建失败(无法从资源加载定义)



我想在eclipse中使用SVNAnt。但是当我运行我的脚本时,我有这样的消息:

Buildfile: X:XXXbinantaxis_bujava.xml
  [typedef] Could not load definitions from resource org/tigris/subversion/svnant/svnantlib.xml. It could not be found.
testSVNAnt:
BUILD FAILED
X:XXXbinantaxis_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中。我找不到类似的问题,也找不到解决方案。

最终使用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>

你必须使用

<taskdef />

代替<typedef/>

其他都很好

也有同样的问题。将"resource"的值从"org/tigris/subversion/svnant/svnantlib.xml"替换为"svntask. xml"。属性"帮我搞定了。

下面的示例: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>
输出

>>>>>

Buildfile: D:...build.xml

ifAvailable:[echo] SVNAnt is available = true构建成功总时间:306毫秒

Replace

 <taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" />

 <taskdef resource="svntask.properties"/>

svntask。属性存在于svnant.jar

相关内容

  • 没有找到相关文章

最新更新