Eclipse – m2eclipse: How to set Eclipse project settings when importing a maven project

eclipsem2eclipsemaven-2

Using m2eclipse Eclipse plugin, everybody on the dev team should be able to checkout source code, import Maven project in Eclipse and be good to go.

I saw m2eclipse is being merged into Eclipse 3.7, and maven-eclipse-plugin won't be maintained any longer, so I'm looking for a m2eclipse-based solution (without running "mvn eclipse:clean eclipse:eclipse" before project import, which is what maven-eclipse-plugin does).

maven-eclipse-plugin allows this in pom.xml

<additionalConfig>
<file>
    <name>.settings/com.google.gdt.eclipse.core.prefs</name>
    <content><![CDATA[
        eclipse.preferences.version=2
        jarsExcludedFromWebInfLib=
        warSrcDir=${project.build.directory}/${project.build.finalName}
        warSrcDirIsOutput=true
        ]]>
    </content>
</file>

The more general question is How would m2eclipse do something similar?
For some cases, just saving the eclipse .settings/prefs file works (e.g. org.eclipse.jdt.ui.prefs), but in this case, com.google.gdt.eclipse.core.prefs is always overwritten on m2eclipse project import.

A specific question is asked here, with no reply.
Thanks!

UPDATE: Not possible now, see request

Best Answer

There are 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 the Google Eclipse Plugin GEP. It needs manual triggering only once after checkout.