Use profiles and this code in your (parent) POM:
<project>
...
<build>
<outputDirectory>${basedir}/${target.dir}/classes</outputDirectory>
<testOutputDirectory>${basedir}/${target.dir}/test-classes</testOutputDirectory>
</build>
<properties>
<target.dir>target</target.dir>
</properties>
<profiles>
<profile>
<id>ide-folders</id>
<properties>
<target.dir>target-ide</target.dir>
</properties>
</profile>
</profiles>
...
Configure the project in your IDE to enable the profile target-ide
when building. Now Maven and the IDE use different folders.
Alternatively, you could enable this profile in your settings.xml
and make the folder target-ide
the default. This way, you wouldn't have to modify the settings of many projects in your IDE. It would even work on your CI build server (it would build into target-ide
but who cares? And if you cared enough, you can enable the profile there as well).
Note: This is based on a blog-post on jroller.com which is down. The Internet Archive has a copy: https://web.archive.org/web/20150527111413/http://www.jroller.com/eu/entry/configuring_separate_maven_output_folders