It doesn't seem to possible to override a plugin execution's goal definition.
开发者_运维问答Let say I have a parent config of Jetty, that defines a
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
now I want locally for a specific project the goal run-exploded
If I try to override the parent definition in local project with
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run-exploded</goal>
                        </goals>
                    </execution>
then I have the effective pom becomes
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                            <goal>run-exploded</goal>
                        </goals>
                    </execution>
I'm surprised, as I have always thought it would override.
Is this a new behavior in Maven3 ?
Is there anyway to get an overriding behavior instead of current one?
The way I found is to disable inherited configuration and creating a new one:
                    <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>
Well this is inheritance working the way as designed. You should consider removing your jetty config from the parent pom and put it in a profile or your try the <inherited> element with value false and see if this works for you.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论