【发布时间】:2014-02-28 13:15:31
【问题描述】:
我想使用单个 pom.xml 在 maven 中运行多个 CMD 命令。
我正在使用这个插件,但它不起作用
<pluginManagement> <plugins>
<plugin>
<!-- ignore unsupported maven operations in eclipse m2e -->
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>unpack</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>run a backup</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yourscript.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </pluginManagement>
我可以知道我该怎么做吗?
【问题讨论】:
-
你想运行哪些命令?
-
'cd files123' 和 'grunt'
-
你看过添加和Ant任务吗?
-
@OveSundberg 不,我不知道。
-
首先使用最新版本的 exec-maven-plugin 并描述什么不符合您的预期?