Ant构建失败,但始终在Jenkins中执行目标
[已解决]-未从我的系统上的默认位置拾取正确的ant contrib jar。必须在生成xml中手动指定路径,如下所示:Ant构建失败,但始终在Jenkins中执行目标,ant,build,path,build-automation,Ant,Build,Path,Build Automation,[已解决]-未从我的系统上的默认位置拾取正确的ant contrib jar。必须在生成xml中手动指定路径,如下所示: <taskdef resource="net/sf/antcontrib/antlib.xml"> <classpath> <pathelement location="/usr/share/ant/lib/ant-contrib-1.0b3.jar"/> </class
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/usr/share/ant/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
-------------------------------------------
<project name="prjName">
<target name="preRun" description="do something">
....
</target>
<target name="Run" description="Run the python script">
<exec executable="python" failonerror="true">
<arg value="${basedir}/run.py" />
<arg value="something" />
</exec>
</target>
<target name="other1" description="do something">
....
</target>
<target name="other2" description="do something">
....
</target>
</project>
您可能需要详细说明什么不起作用。ant contrib安装正确吗?因为我的声誉分数很低,我无法回答自己的问题,所以没有解决。我现在已经编辑过了。谢谢@苏米特现在你的成绩不错。你应该能回答这个问题
<macrodef name="test-case">
<sequential>
<trycatch>
<try>
<exec executable="python" failonerror="true">
<arg value="${basedir}/read.py" />
</exec>
</try>
<catch>
<echo>Investigate exceptions in the run!</echo>
</catch>
<finally>
<antcall target="other1" />
</finally>
</trycatch>
</sequential>
</macrodef>
<target name="other1" description="do something">
....
</target>