覆盖给定执行ID的Maven插件目标定义

nod*_*dje 5 configuration plugins maven

似乎无法覆盖插件执行的目标定义.

假设我有一个Jetty的父配置,它定义了一个

                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
Run Code Online (Sandbox Code Playgroud)

现在我想在一个特定项目的本地目标运行爆炸

如果我尝试用本地项目覆盖父定义

                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run-exploded</goal>
                        </goals>
                    </execution>
Run Code Online (Sandbox Code Playgroud)

然后我有效的pom变成了

                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                            <goal>run-exploded</goal>
                        </goals>
                    </execution>
Run Code Online (Sandbox Code Playgroud)

我很惊讶,因为我一直以为它会覆盖.

这是Maven3中的新行为吗?

反正是否有一种压倒一切的行为而不是当前行为?

Vas*_*liy 10

我找到的方法是禁用继承配置并创建一个新配置:

                    <execution>
                        <id>start-jetty</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>my-start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run-exploded</goal>
                        </goals>
                    </execution>
Run Code Online (Sandbox Code Playgroud)