Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 255
Marius Avatar asked Dec 30 '10 11:12

Marius


Video Answer


2 Answers

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.

like image 181
Martin Ackermann Avatar answered Oct 27 '22 11:10

Martin Ackermann


Try asking your question on m2eclipse forum on eclipse.org. You will likely reach far more people familiar with m2eclipse that way.

http://www.eclipse.org/forums/index.php?t=thread&frm_id=61

like image 32
Konstantin Komissarchik Avatar answered Oct 27 '22 10:10

Konstantin Komissarchik