想从Maven运行ant脚本

时间:2015-12-31 07:15:57

标签: java maven ant

enter image description here

enter image description here

JAVA_HOME目前设置为“C:\ Program Files \ Java \ jdk1.8.0_45”..仍然显示值直到jre。

I have added tools.jar in Ant->Runtime->Globle Entries
Also verified that installed jre is having path "C:\Program Files\Java\jdk1.8.0_45"
Copied "C:\Program Files\Java\jdk1.8.0_45\lib\tools.jar" to "C:\Program Files\Java\jre1.8.0_45\lib\" folder

Is there any other solution to this problem?

1 个答案:

答案 0 :(得分:0)

您必须将ant-contrib*.jar包含在Ant安装中(在<ant_home>/lib目录中),或者在<classpath>中包含明确的build.xml

<taskdef resource="...">
    <classpath>
        <pathelement location="my_dir/ant-contrib.jar"/>
    </classpath>
</taskdef>

请参阅http://ant-contrib.sourceforge.net/#install