【发布时间】:2013-06-08 11:51:52
【问题描述】:
我有一个简单的 thor 脚本,可以将资源从我项目中的子模块复制到目标目录。我已将 Exec Maven 插件配置为在编译阶段运行脚本。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>thor</executable>
<arguments>
<argument>build:task</argument>
</arguments>
</configuration>
</plugin>
当使用 thor build:task 从 shell 执行时,我的 thor 脚本运行良好,但由于某种原因,我的 mvn compile 失败并出现以下错误:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default) on project imsprocess: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default) on project imsprocess: Command execution failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
在错误消息之前,我可以看到我的脚本打印消息,而且它似乎工作正常。构建在没有 exec 插件的情况下完成。
【问题讨论】:
标签: maven thor exec-maven-plugin