Search code examples
eclipsemaven-2m2eclipsemaven-eclipse-plugin

How can I configure additional eclipse settings with m2eclipse?


With the maven eclipse plugin, I can configure checkstyle or sonar configurations by adding the necessary invocations to the pom.xml and calling "mvn eclipse:eclipse" to create the project configuration.

Some members of my team want to just use "Import Maven project" and therefore don't get the benefits of the project preconfigurations. Is there a way to provide the same (or similiar) hints to m2eclipse?

What I want to accomplish is that people simply "Import Maven Project", and they automatically get a project preconfigured with the correct checkstyle configuration (which is possibly downloaded from somewhere as defined in the POM) without having to manually go into the project preferences and click around a lot. That somehow defeats the purpose of automatic project generation :-)


Solution

  • There are more detailed answers to this topic in Can I Configure m2eclipse through pom.xml?: Completely automatic configuration can only be achieved with a ProjectConfigurator. But there is a solution based on AntRun and XMLTask even for FindBugs and Sonar. It needs manual triggering only once after checkout.