我创建了一个 Maven Ant 插件,它根据指南捆绑了大量 Ant 宏
http://books.sonatype.com/mcookbook/reference/ch04s04.html http://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html#ex-maven-metadata
我有插件工作并使用 Ant contrib 虽然我有一个问题,它使用
Ant 1.7而不是1.8,这意味着我的包含语句失败
[ERROR] Failed to execute goal com.openbet.shared:openbet-shared_ant:2.4-SNAPSHOT:options (default-cli) on project openbet-office: Failed to execute: Executing Ant script: ci.build.xml [run]: Failed to parse. Problem: failed to create task or type include
[ERROR] Cause: The name is undefined.
[ERROR] Action: Check the spelling.
[ERROR] Action: Check that any custom tasks/types have been declared.
[ERROR] Action: Check that any <presetdef>/<macrodef> declarations have taken place.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
我已经设法使用 echoproperties 来验证它的 1.7
[echoproperties] java.runtime.name=Java(TM) SE Runtime Environment
[echoproperties] ant.file.ci.plugin=/tmp/plexus-ant-component586072324287432616.build.xml
[echoproperties] sun.boot.library.path=/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64
[echoproperties] java.vm.version=20.1-b02
[echoproperties] ant.version=Apache Ant version 1.7.1 compiled on June 27 2008
[echoproperties] ant.core.lib=/home/jmorgan/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
[echoproperties] ant.java.version=1.6
[echoproperties] java.vendor.url=http\://java.sun.com/
[echoproperties] java.vm.vendor=Sun Microsystems Inc.
使用该插件的项目也使用了 Antrun 插件。这是 > 蚂蚁 1.8
[echoproperties] ant.core.lib=/home/jmorgan/.m2/repository/org/apache/ant/ant/1.8.2/ant-1.8.2.jar
[echoproperties] ant.java.version=1.6
[echoproperties] ant.project.default-target=package
[echoproperties] ant.project.invoked-targets=test
[echoproperties] ant.project.name=maven-antrun-
[echoproperties] ant.version=Apache Ant(TM) version 1.8.2 compiled on December 20 2010
如果我在命令行上运行 ant,我会得到
> ant -v
Apache Ant version 1.8.0 compiled on April 9 2010
我需要做的就是使用 1.8 获取插件,我认为一切都应该到位
非常感谢任何帮助