gpt4 book ai didi

java - 如何使用 antcontrib svn ant。错误原因: The name is undefined

转载 作者:行者123 更新时间:2023-12-01 09:05:48 25 4
gpt4 key购买 nike

我正在尝试使用 ant antcontrib ,我将 jar 文件添加到文件夹中,然后使用 pathelement 指向它

        <pathelement location="D:\pppp\SVN1.8.Client\ant-contrib-1.0b3.jar" />

但是使用下面的代码我可能会收到此错误

build failed
\TEST.xml:59: Problem: failed to create task or type trycatch
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.

<target name="Add2SvnKw">

<path id="path.svnant">
<pathelement location="D:\pppp\SVN1.8.Client\svnant.jar" />
<pathelement location="D:\pppp\SVN1.8.Client\svnClientAdapter.jar" />
<pathelement location="D:\pppp\SVN1.8.Client\svnkit-javahl-1.8.0.jar" />
<pathelement location="D:\pppp\SVN1.8.Client\svnkit-1.8.0.jar" />
<pathelement location="D:\pppp\SVN1.8.Client\sequence-library-1.0.2.jar" />
<pathelement location="D:\pppp\SVN1.8.Client\ant-contrib-1.0b3.jar" />
</path>

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="path.svnant" />

<svnSetting svnkit="false" javahl="false" id="svn.settings"
username="*******" password="******$" failonerror="false"
dateFormatter="yyyy-MM-dd HH:mm"
/>

<trycatch property="error-prop" >
<try>
<svn refid="svn.settings">

<singleinfo target="***url" property="revision.result" request="revision" />
</svn>
</try>
<catch>
<echo message=" there is an error catched..."/>
</catch>
</trycatch>


<echo message="File Name: ${name.result}" />
<echo message="Author of last commit: ${author.result}" />
<echo message="Date of last commit: ${lastDate.result}" />
<echo message="revision of last commit: ${revision.result}" />

</target>

最佳答案

我添加了这个并且它有效

    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="path.svnant" />

关于java - 如何使用 antcontrib svn ant。错误原因: The name is undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41297700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com