m2eclipse and separate output folders

The recent versions of m2eclipse (> 0.9.3) are a nightmare to get working. The biggest issues is that if you run a command line build whilst eclipse is working, one or the other will get totally borked. there is a section in the FAQ describing how to use separate output folders. Essentially you have to tell eclipse to use a certain maven profile, which changes your project configuration.

The instructions almost work. However, some plugins need the project.build.directory variable (for example for code-generation) to be set, and the FAQ does not achieve that.

Ordinarily you would have to specify the directory element in the build section:


If you do this however, anything you launch in eclipse will not have the correct classpath. You must fully specify the output directories:


I assume this is because m2eclipse is doing some kind of parsing of the pom.xml

Maven Default Execution Ids

Maven execution IDs have changed in maven versions greater than 2.2.0.

It seems that you can disable a default a default execution by binding it to the phase “none”: