2

Is there a way to override configurations of the m2e lifecycle-mapping plugin in a child pom.xml? I have a parent pom.xml that I can't change. It contains the following xml:

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>some.group.id</groupId>
                                <artifactId>some-artifact-id</artifactId>
                                <versionRange>[1.x.x,</versionRange>
                                <goals>
                                    <goal>someGoal</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore/>
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

I want to override this behaviour in my project. I tried to put the same configuration in my pom.xml and replace <ignore/> with <execute/>, but that just results in a merged configuration containing <ignore/> and <execute/>. Is there an other way I can try to get rid of this m2e lifecycle mapping?

  • Where did you place the (almost) same configuration in your pom. Can you add that segment to the post please. – hotzst Oct 1 '15 at 13:42
  • Its on the same position as the configuration from the parent pom. That is project/build/pluginManagement/plugins/plugin. When I use Eclipse to open the "Effective POM" tab, I see the action node <action><execute /><ignore /></action> – lrxw Oct 2 '15 at 7:16
  • Try putting it in project/build/plugins/plugin instead. This should override the plugin definition that is done in the pluginManagement section of the parent. – hotzst Oct 2 '15 at 7:42
  • I can put that configuration there, but that wont work. The lifecycle-mapping plugin is not a real plugin. It is just a way to tell the Eclipse M2e plugin how to handle other maven plugins in the Eclipse build. If there is no connector, the usual way is to use the lifecycle-mapping plugin to tell m2e not to execute this plugin. Nevertheless in a normal maven build, the plugin is executed. – lrxw Oct 2 '15 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.