且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在一个目标中结合许多Maven目标

更新时间:2023-09-17 21:04:34

另一个与我的其他答案完全不同的解决方案是使用 exec-maven-plugin ,目标为 exec:exec

Another solution that differs completely from my other answer would be to use the exec-maven-plugin with the goal exec:exec.

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <configuration>
                <executable>mvn</executable>
                <arguments>
                    <argument>clean</argument>
                    <argument>compile</argument>
                    <argument>hibernate3:hbm2java</argument>
                </arguments>
            </configuration>
        </plugin>
    </plugins>
</build>

然后你就这样运行:

mvn exec:exec

通过这种方式这样做你没有改变任何其他插件,也没有绑定任何阶段。

By doing it this way you are not changing any of the other plugins and it is not bound to any phases either.