svnant的BUILD FAILED Problem: failed to create task or type svnSetting Cause: The name is undefined原因

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/pengchang_1981/article/details/50441253

最近复习了下ant的使用,参考了不会用ant打包、部署项目的工程师,不是一个好程序员(测试)这篇博文的方法,执行svnant这个插件却部署失败。提示如下:

BUILD FAILED
D:\SvnAnt\build\build.xml:61: Problem: failed to create task or type svnSetting
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.

该博文下面评论也有人提出该问题。网上搜了下没找到解决方法。

重新看问题报错是出在这行

<svnSetting id="svn.settings" javahl="false" svnkit="true" username="${svn.username}" password="${svn.password}" failonerror="true"/>

看错误提示是不能创建svnSetting这个task,这个svnSettring的名字没有定义。下面建议检查tasks,types或者def声明是否正确。

我就看到上面有句声明

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath"/>
于是就进博主提供下载的svnant包里看定义的这个svnantlib.xml,找到svnant.jar打开按路径找到svnantlib.xml一看,


里面没有定义svnSetting,再一看下载的包的版本是svnant-1.3.0,于是在网上一搜,这个插件最新版本是svnant-1.3.1,在ANT集成SVNANT访问SVN(Subversion)找到svnant-1.3.1的包,同样找到svnant.jar打开按路径找到svnantlib.xml一看,就有svnSetting的定义了。


将svnant-1.3.1的包的jar替换上去那个BUILD FAILED的问题就迎刃而解了。


总结: 使用svnant插件中这个svnSetting必须使用svnant-1.3.1的包,使用1.3.1版本以前的因为没定义svnSetting这个就会出现build failed。

猜你喜欢

转载自blog.csdn.net/pengchang_1981/article/details/50441253