本文介绍了Maven Antrun不执行任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Maven AntRun插件1.6,从他们的示例中,我无法编写以下要执行的ant任务.
I'm using Maven AntRun plugin 1.6 and from their example I cannot code the following ant task to be executed.
示例网址: http://maven.apache.org/plugins/maven- antrun-plugin/examples/classpaths.html
当我执行mvn antrun:run时,我仅收到以下消息.未定义蚂蚁目标-跳过
I just get the following message when I execute mvn antrun:run.No ant target defined - SKIPPED
我做错了什么?
这是我的POM:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<configuration>
<target>
<property name="compile_classpath" refid="maven.compile.classpath" />
<property name="runtime_classpath" refid="maven.runtime.classpath" />
<property name="test_classpath" refid="maven.test.classpath" />
<property name="plugin_classpath" refid="maven.plugin.classpath" />
<echo message="compile classpath: ${compile_classpath}" />
<echo message="runtime classpath: ${runtime_classpath}" />
<echo message="test classpath: ${test_classpath}" />
<echo message="plugin classpath: ${plugin_classpath}" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
推荐答案
由于已在pom.xml
中配置了maven antrun插件,因此只需调用为该插件配置的生命周期目标.在这种情况下
Since you have configured the maven antrun plugin in your pom.xml
, you only need to call the lifecycle goal configured for the plugin. In this case
mvn compile
这将满足需要.
这篇关于Maven Antrun不执行任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!