【发布时间】:2014-02-07 11:37:20
【问题描述】:
我正在使用 exec-maven-plugin 使用 maven 执行批处理文件。我让它在打包阶段运行,但我需要它更早运行。编译阶段就好了。
批处理脚本会生成一个包含 svn 版本的属性文件。当阶段设置为打包时,它看起来就像是这样做之后它制作了war文件。对我来说太晚了。
但是,在 eclipse 中我得到这个错误:
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (execution: Version, phase: compile)
我的 pom.xml 的相关部分:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>Version</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>\my\path\version\version.bat</executable>
</configuration>
</plugin>
首先,exec-maven-plugin 仍然是正确的工具吗?
其次,它可以在比包更早的阶段运行吗?这在任何地方都有记录吗? exec-maven-plugin 项目页面上的邮件列表存档链接已过期。
【问题讨论】:
-
你为什么需要这样的批处理文件,因为这会使你的构建不再可移植。除此之外,批处理文件在做什么?
标签: java maven-3 exec-maven-plugin