Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348791

Summary: m2e project configurators don't run in a defined order
Product: z_Archived Reporter: benson margulies <bimargulies>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: fbricon, gregory.amerson, igor
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 449495    
Bug Blocks:    

Description benson margulies CLA 2011-06-08 15:06:04 EDT
Build Identifier: 20110602-0820

While debugging, I am stopped at {com.basistech.m2e.code.quality.checkstyleConfigurator=com.basistech.m2e.code.quality.checkstyleConfigurator:M2Eclipse maven-checkstyle-plugin project configurator, com.basistech.m2e.code.quality.pmd=com.basistech.m2e.code.quality.pmd:M2E-PMD, org.eclipse.m2e.jdt.javaConfigurator=org.eclipse.m2e.jdt.javaConfigurator:JDT}.

The configurators come back in the following order:

{com.basistech.m2e.code.quality.checkstyleConfigurator=com.basistech.m2e.code.quality.checkstyleConfigurator:M2Eclipse maven-checkstyle-plugin project configurator, com.basistech.m2e.code.quality.pmd=com.basistech.m2e.code.quality.pmd:M2E-PMD, org.eclipse.m2e.jdt.javaConfigurator=org.eclipse.m2e.jdt.javaConfigurator:JDT}

This can't work, since JDT needs to run first. I can't seem to discover any way to influence the order.

I don't yet understand how to get into this state where the order looks like this.


Reproducible: Always
Comment 1 benson margulies CLA 2011-06-08 15:12:52 EDT
org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade.putSetupMojoExecution(MojoExecutionKey, MojoExecution)

creates a HashMap, not a LinkedHashMap, so the order is unpredictable, which might be relevant.
Comment 2 benson margulies CLA 2011-06-08 15:13:03 EDT
org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade.putSetupMojoExecution(MojoExecutionKey, MojoExecution)

creates a HashMap, not a LinkedHashMap, so the order is unpredictable, which might be relevant.
Comment 3 benson margulies CLA 2011-06-08 15:23:21 EDT
I may have a clue, but I don't know what to do about the clue.

I suspect that, from a lifecycle standpoint, PMD runs first. But from a configuration standpoint, PMD has to run *last*.
Comment 4 Eclipse Genie CLA 2014-05-21 09:10:35 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Igor Fedorenko CLA 2014-05-21 09:17:11 EDT
Thank for the reminder, Genie, but this is one of the long-term problems we'll need to address eventually, I'll take it from here.
Comment 6 Fred Bricon CLA 2015-05-04 00:21:24 EDT
You can now replace secondaryTo with runsAfter="org.eclipse.m2e.jdt.javaConfigurator?"

Note the ? (==optional) is necessary because org.eclipse.m2e.jdt.javaConfigurator is bound to a different mojo execution than checkstyle/pmd.

See bug #449495

*** This bug has been marked as a duplicate of bug 449495 ***
Comment 7 Denis Roy CLA 2021-04-19 13:23:46 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/