如何在Ant构建中使用cpp-tasks

时间:2012-12-06 08:21:32

标签: hibernate ant open-source ant-contrib

我正在使用Ant 1.8.2我收到此错误:

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.
我用Google搜索了一下。并且实现了ant-contrib缺失。之后,我添加了ant-contrib-1.0b3.jar。但是这个jar不支持Ant 1.8.2并且我不知道使用cpp-tasks。我读过http://ant-contrib.sourceforge.net/cpptasks/index.html这个,但我没有克服。

问候。

1 个答案:

答案 0 :(得分:0)

我在你的类路径中没有ant-contrib jar。 下载这个罐子。 并转到日食中的窗口首选项。 选择ant-runtime-(Ant Home Entries(默认))选择 添加外部罐子。在你的类路径中包含jar ant-contrib按ok。

你的build.xml应该是这样的

<?xml version="1.0" encoding="UTF-8"?>
        <project name="JarCreation" default="Jar" basedir="." xmlns:ac="antlib:net.sf.antcontrib">
        <property name="array" value="a,b,c,d"/>
        <target name="Jar">
        <ac:for list="${array}" param="letter">
        <sequential>
        <echo>Your Code Here</echo>
        <ac:var name="test" value="somethin"/>
        </sequential> 
        </ac:for>  
        </target>
        </project>

**

它会运行!

相关问题