【发布时间】:2014-03-30 18:55:56
【问题描述】:
我想在 maven 中使用单个 pom.xml. 运行多个 CMD 命令
我可以知道我该怎么做吗?
例如
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>id1</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmd1</executable>
</configuration>
</execution>
<execution>
<id>id2</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmd2</executable>
</configuration>
</execution>
</executions> </plugin>
【问题讨论】:
-
那么问题出在哪里?它有效还是无效?除此之外,为什么您需要在构建中执行特定于操作系统的东西?某种测试?如果是,
install阶段看起来是错误的。 -
不,它只是一个例子。我想在构建项目时运行 grunt 命令。
-
我不确定,但这可能是更好的解决方案:github.com/allegro/grunt-maven-plugin