我已经执行了以下命令
export ANT_HOME=/xenv/ant/X/1.7.1
export SVN_HOME=/xenv/svn-c/X/1.6.6l_64
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$SVN_HOME/bin:$ANT_HOME/bin:$ORACLE_HOME/bin
我有一个apphermess .xml文件当我执行这个命令
ant -f apphermes.xml tar.zip
我在apphermess .xml中得到以下错误:66:
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
在apphermess .xml第66行我有以下代码:
<!-- - - - - - - - - - - - - - - - - -
63 target: svn.checkout
64 - - - - - - - - - - - - - - - - - -->
65 <target name="svn.checkout" depends="prepare,svn.login">
66 <svn username="${svn.username}" password="${svn.password}">
67 <checkout url="${svn.app.path}" revision="${svn.revision}" destPath="${build.dir}/svn/${svn.app.dirname}" />
68 <checkout url="${svn.commons}" revision="${svn.revision}" destPath="${build.dir}/svn/commons" />
69 <checkout url="${svn.release}" destPath="${build.dir}/svn/release" />
70 <info target="${svn.revision.check.root}" />
71 </svn>
编辑:
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${env.ANT_CONTRIB}/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
是否定义了SVN的Ant任务?在我们的构建中,我们在顶部有这一行:
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpath="svnant.jar"/>
然后我们可以很好地引用任务