Nested compile source roots in effective POM cause bad Eclipse build path
-------------------------------------------------------------------------
Key: MECLIPSE-335
URL: http://jira.codehaus.org/browse/MECLIPSE-335
Project: Maven 2.x Eclipse Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Maven 2.0.7, JDK 1.5.0_12, WinXP
Reporter: Benjamin Bentmann
Source generating plugins like for JavaCC or JFlex usually add their output
folder to the POM as a compile source root. If these source directories happen
to be nested, i.e. "src/main/java" and additional something like
"src/main/java/org/apache", mvn eclipse:eclipse produces the following bad
.classpath contents with overlapping build paths:{code:xml}
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/java/org/apache"/>
...
</classpath>
{code}
While this issues relates to MECLIPSE-114, I really think my problem is caused
by Maven.
Though the maven-eclipse-plugin causes the problem to manifest itself, it might
not be the proper place to solve it as it appears to be a more general issue
(i.e. the Maven Eclipse Integration might also be affected, though I did not
test this). Surely, each and every plugin developer could be told to check for
source directory nesting but I consider this an error-prone approach. I would
rather appreciate either that MavenProject.addCompileSourceRoot() automatically
ignores nested source directories (if such a general change is acceptable) or
that new methods in MavenProject are introduced that allow for conditional
addition of source roots only if they do not nest with existing roots such that
plugin developers can easily fix the problem.
--
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