【发布时间】:2014-04-19 00:23:40
【问题描述】:
我在 maven pom.xml 文件中添加了几个新插件。
当我发出以下命令时,我无法弄清楚为什么 exec-maven-plugin 和 maven-resources-plugin 没有运行:mvn install。其他 maven 插件确实按预期执行。
当我运行mvn exec:exec 时,exec-maven-plugin 确实会运行。
我尝试了许多不同的阶段,但无济于事。
我在这里做错了什么,我应该尝试什么?
这是我的 maven 文件的相关部分
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>build-spa-bower</id>
<phase>validate</phase>
<configuration>
<executable>bower</executable>
<arguments>install</arguments>
<workingDirectory>src/main/spa</workingDirectory>
</configuration>
</execution>
<execution>
<id>build-spa-grunt</id>
<phase>validate</phase>
<configuration>
<executable>bower</executable>
<arguments>install</arguments>
<workingDirectory>src/main/spa</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>resource-spa</id>
<phase>compile</phase>
<configuration>
<outputDirectory>${project.groupId}/${project.artifactId}/spa</outputDirectory>
<resources>
<directory>src/main/spa/dist</directory>
<filtering>false</filtering>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- ... -->
</plugins>
编辑:
找到了 exec 插件的答案,但还没有找到资源插件的答案。
exec 插件需要一个目标才能触发
将<goals><goal>exec</goal></goals> 添加到每个<execution> 对我有用。
【问题讨论】:
标签: maven maven-plugin pom.xml exec-maven-plugin maven-resources-plugin