Maven Antrun 不执行任务
我正在使用 Maven AntRun 插件 1.6,从他们的示例中我无法编写要执行的以下 ant 任务的代码。
示例网址: http://maven.apache.org/plugins/maven-antrun-plugin /examples/classpaths.html
当我执行 mvn antrun:run 时,我收到以下消息。 没有定义 ant 目标 - 已跳过
我做错了什么?
这是我的 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>
I'm using Maven AntRun plugin 1.6 and from their example I cannot code the following ant task to be executed.
Example url: http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
I just get the following message when I execute mvn antrun:run.
No ant target defined - SKIPPED
What am I doing wrong?
Here's my 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
记下 id
并运行命令
这样做的原因:
如果您实际上不想“编译”,则运行“mvncompile”来执行其他操作可能会适得其反。
try this
note the id
and run the command
reason for doing this way:
if you don't actually want to "compile", running "mvn compile" to execute something else could be counter productive.
由于您已经在
pom.xml
中配置了maven antrun插件,因此您只需要调用为插件配置的生命周期目标即可。在这种情况下,mvncompile
这将完成所需的工作。
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 casemvn compile
This will do the needful.