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

gal*_*lme 1 maven exec-maven-plugin

我想使用单个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>
Run Code Online (Sandbox Code Playgroud)

为此,构建是成功的.是否可以在同一个pom.xml中执行另外一个命令?我无法做到这一点.所以有人请帮助如何在pom.xml中添加它

rzy*_*mek 11

答案可以在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>
Run Code Online (Sandbox Code Playgroud)