gpt4 book ai didi

maven - 如何在单个 pom.xml 中使用 maven 执行多个命令提示符命令

转载 作者:行者123 更新时间:2023-12-01 19:49:23 25 4
gpt4 key购买 nike

我想使用单个 pom.xml 在 Maven 中运行多个命令提示符命令。我怎样才能做到这一点?

例如:我有 2 个命令要执行。我正在使用 exec-maven-plugin 执行第一个命令.
下面是我的 pom.xml 执行第一个命令的部分:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>load files</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>

<executable>windchill</executable>
<arguments>
<argument>wt.load.LoadFileSet</argument>
<argument>-file</argument>
<argument>${basedir}/fileSet.xml</argument>
<argument>-UNATTENDED</argument>
<argument>-NOSERVERSTOP</argument>
<argument>-u</argument>
<argument>wcadmin</argument>
<argument>-p</argument>
<argument>wcadmin</argument>
</arguments>

</configuration>
</plugin>

为此,构建成功。
是否可以在同一个 pom.xml 中像上面一样再执行一个命令?我没能做到。所以有人请帮助如何在 pom.xml 中添加它

最佳答案

答案可以在 FAQ 中找到.
完整答案在这里:http://article.gmane.org/gmane.comp.java.maven-plugins.mojo.user/1307

<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>

关于maven - 如何在单个 pom.xml 中使用 maven 执行多个命令提示符命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17592823/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com