[英]Execute cmd command using maven pom.xml file
I want to run multiple CMD commands in maven using single pom.xml. 我想使用单个pom.xml在Maven中运行多个CMD命令。
I am using this plugin but its is not working 我正在使用此插件,但无法正常工作
<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>
May I know how can I do that? 我可以知道该怎么做吗?
Try something like 尝试类似
<plugin>
<artifactId>maven-antrun-plugin </artifactId>
<executions>
<execution>
<phase>install </phase>
<configuration>
<tasks name="Run Notepad">
<exec
dir="${basedir}"
executable="${basedir}/notepad.exe"
failonerror="true">
<arg line=""/>
</exec>
</tasks>
</configuration>
<goals>
<goal>run </goal>
</goals>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.