在特定阶段后使用 Maven 运行任务
如何在 Maven Eclipse:Eclipse 阶段运行任务?
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>eclipse:eclipse</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<executable>java</executable>
<mainClass>a.b.c.Main</mainClass>
</configuration>
</execution>
</executions>
这个配置好像不太好吧。
how run a task post maven eclipse:eclipse phase ?
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>eclipse:eclipse</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<executable>java</executable>
<mainClass>a.b.c.Main</mainClass>
</configuration>
</execution>
</executions>
this configuration seems not ok.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能,
eclipse:eclipse
不是一个阶段。要么将一些目标绑定在同一阶段(如果这甚至有意义),它们就会按照声明顺序执行。
或者从命令行调用它们(并且可以选择提供从命令行运行时使用的默认配置)。例如,您可以执行以下操作:
然后调用:
You can't,
eclipse:eclipse
is not a phase.Either bind some goals on the same phase (if this even makes sense) and they would get executed in their declaration order.
Or invoke them from the command line (and optionally provide a default configuration to be used when running from the command line). For example, you could do:
And then invoke: