Community
Participate
Working Groups
Build Identifier: Ideally the enforcer plugin would run and failures would show in eclipse as errors (I haven't looked at any code to see how feasible this will be). Previous versions of m2eclipse would run the enforcer plugin and the problems would show in the maven console. Has anyone started work on this one? If not, what connector would you suggest as a good one to look at as an example? Most of the existing ones look like code generators to me. If I get some time I'd like to look into this in the next couple weeks; any pointers will be appreciated. Reproducible: Always
Ok, I took an initial try at this, and I've put my code here: https://github.com/pmv/m2eclipse-extras Basically I just copied the antlr connector. It seems to work. If an enforcer rule fails, there's an error marker with a description of "Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed..." (You actually have to look in the Maven Console for the error detail, but I didn't take the time to see if the error description was something I could change) The one coding change I wasn't sure of is I had to override the AbstractJavaProjectConfigurator.configureRawClasspath method to avoid a NullPointerException. (https://github.com/pmv/m2eclipse-extras/blob/master/org.sonatype.m2e.enforcer/src/org/sonatype/m2e/enforcer/internal/EnforcerProjectConfigurator.java) I'm not familiar enough with m2e internals to know if that was the correct thing to do or not. Could someone review this and give feedback? If it's good enough, let me know what the next steps would be.
Few things. You didn't need to fork entire m2eclipse-extras, standalone repo makes more sense in this case (of course, you are welcome to use code m2eclipse-extras as starting point). If you only need to execute enforcer plugin as part of (full?) workspace build, you can use <execute/> mapping action, so you won't need EnforcerBuildParticipant/EnforcerProjectConfigurator java classes. If you decide to keep EnforcerProjectConfigurator and build participant, to provide better error messages, for example, you probably want to extend AbstractProjectConfigurator directly and not AbstractJavaProjectConfigurator.
closing old/stale bugreports
Moved to https://github.com/eclipse-m2e/m2e-core/issues/