如何在单个pom.xml中使用Maven执行多个命令提示符命令 [英] how to execute multiple command prompt commands using maven in single pom.xml

查看:104
本文介绍了如何在单个pom.xml中使用Maven执行多个命令提示符命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用单个pom.xml在Maven中运行多个命令提示符命令.我该怎么办?

I want to run multiple command prompt commands in maven using single pom.xml. How can I do that?

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

For ex: I have 2 commands to execute. I am executing the first command by using exec-maven-plugin. Below is the portion of my pom.xml to execute the first command:

<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

For this the build is success. Is it possible to execute one more command just like above in the same pom.xml? I was not able to do that. So someone please help how to add it in pom.xml

推荐答案

答案可以在常见问题解答. 完整的答案在这里: http://article.gmane .org/gmane.comp.java.maven-plugins.mojo.user/1307

The answer can be found in the FAQ. The full answer is here: 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>

这篇关于如何在单个pom.xml中使用Maven执行多个命令提示符命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆