Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :3
Description
Currently when eclipse generates .classpath file, the subprojects' target paths default to the parent project's target path.
for example if you have a POM A which is a parent project, and POM B and C that are subprojects of A, generated classpath will have :
src/java -> target/classes
src/test -> target/test-classes
B/src/java -> target/classes
B/src/test -> target/test-classes
C/src/java -> target/classes
C/src/test -> target/test-classes
If I get a chance, I'll post a patch.
-
Hide
- classpath.jelly.MPECLIPSE-71.zip
- 21/May/05 12:40 AM
- 2 kB
- Yujin Kim
- Download Zip
-
- classpath.jelly.patch
- 05/Feb/05 1:18 PM
- 9 kB
- Yujin Kim
-
Hide
- maven-eclipse-plugin-test.zip
- 05/Feb/05 1:19 PM
- 14 kB
- Yujin Kim
-
- maven-eclipse-plugin-test/.classpath 2 kB
- maven-eclipse-plugin-test/.project 0.6 kB
- maven-eclipse-plugin-test/classpath.jelly 18 kB
- maven-eclipse-plugin-test/maven.xml 1 kB
- maven-eclipse-plugin-test/project.properties 0.3 kB
- maven-eclipse-plugin-test/project.xml 1 kB
- maven-eclipse-plugin-test/.../.classpath 0.8 kB
- maven-eclipse-plugin-test/.../message.properties 0.0 kB
- maven-eclipse-plugin-test/.../project.xml 0.4 kB
- maven-eclipse-plugin-test/.../message.properties 0.0 kB
- maven-eclipse-plugin-test/.../.classpath 0.8 kB
- maven-eclipse-plugin-test/.../project.xml 0.4 kB
Activity
patch for allowing multiproject .classpath generation.
i tried avoid making risks and pretty much copied the code that handles the single project classpath and put that into a loop using reactor.
limitation: if the sub project is not under the current root, this probably won't work, ie if root project A and child project B are at the same level, instead of B residing under A, this will most likely fail.
also i didn't put too much effort into parsing the exclude filter for reactor. just checking if it's empty then add the root project. I think eventually the part that handles the single project and the code i added can be merged.
use classpath.jelly.MPECLIPSE-71.zip for SVN.
also addd one propject properties but wasn't sure where it needs to be patched.
maven.multiproject.eclipse.includes: if not set, falls back to maven.multproject.includes, or "*/project.xml" if it's not set either
maven.multiproject.eclipse.excludes: to exclude subprojcet from being included in the eclipse classpath. (such as sandbox projects).
One issue I know still exists is when you have multiproject stucture for webapps. The way this is done, you can't have a subproject level dependency. Because eclipse doesn't support multi-tier project, for eclipse project to be able to see the dependencies is to have the dependencies declared at the top level project.
There's another patch at http://issues.apache.org/jira/browse/AGILA-13 which I had some success with.
Since i uploaded the patch, I also added eclipse project depdency handling, so inside eclipse, i can let eclipse build multiple "eclipse" projects without having to rely on maven, while continuous build, etc can still use maven to build it.
i'll submit a patch if/when the above patch(or the one in agila) makes it to the main tree.
I had the same need and created my own version. Submitted patch is actually more robust than what I did so I am not submitting mine. However, I have a couple of suggestions:
1) Generated sources dir for nested projects should be obtained with something like this:
<j:set var="nestedContext" value="$
{reactorProject.context}"/>
<j:invoke var="genSrc" on="$
" method="getVariable">
<j:arg value="maven.gen.src"/>
</j:invoke>
This way nested project's potentially different setting is respected. Same should be done for maven.build.dir
2) I put multiproject handling into a separate "multiclasspath.jelly" file and included it in the main classpath.jelly. I like smaller files as I feel they are easier to work with/find things in.
Actually I take back what I said. Currently maven-eclipse plugin doesn't support multiproject period. I forgot I had to write my own jelly tag to make it work in our multiproject environment.
I think I do have a solution for this and will post a patch (will need to modify classpath.jelly) for this whenever I can.