[
http://jira.codehaus.org/browse/MECLIPSE-134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_86127
]
Daniel Brolund commented on MECLIPSE-134:
-----------------------------------------
A workaround could look like this:
Set the property myTarget to the empty string in the pom.xml (or preferrably
the parent pom).
<project ...>
...
<properties>
<myTarget>target/classes/</myTarget>
</properties>
Set the output directories in the (parent)pom.xml to
<project ...>
...
<build>
<outputDirectory>${myTarget}main</outputDirectory>
<testOutputDirectory>${myTarget}test</testOutputDirectory>
</build>
When running "mvn eclipse", always provide the -DmyTarget=classes/ parameter
like this
mvn -DmyTarget=classes/ eclipse
When you set the parameter on the commandline it will overrule the setting in
the pom.
For all other tasks, e.g. mvn test, don't provide the -D parameter and it will
work normally.
I guess you could be more (or less) elaborate with the paths, but this will
probably do the trick.
Cheers
Daniel
> target/classes not acceptable for eclipse
> -----------------------------------------
>
> Key: MECLIPSE-134
> URL: http://jira.codehaus.org/browse/MECLIPSE-134
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Affects Versions: 2.0, 2.1, 2.2
> Reporter: Jörg Hohwiller
> Assigned To: fabrizio giustina
> Priority: Minor
>
> "mvn eclipse:eclipse" causes an eclipse configuration where the classfiles
> generated by eclipse go to the same directory as the classes generated by
> maven. This is extremly evil! Eclipse and maven are independent tools and
> should therefore not compile to the same target folder causing side effects.
> Especially when "mvn clean" is called and you re-run an existing application
> inside eclipse, and get a NoClassDefFoundError you can get slightly confused.
> Please use anything else than "target/...". My suggestion would be
> ".eclipse-build".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira