Issue Details (XML | Word | Printable)

Key: MPECLIPSE-71
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Yujin Kim
Votes: 3
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Eclipse Plugin

Better support for multiproject with eclipse plugin

Created: 03/Feb/05 01:45 AM   Updated: 05/Dec/05 09:48 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive classpath.jelly.MPECLIPSE-71.zip (2 kB)
2. Text File classpath.jelly.patch (9 kB)
3. Zip Archive maven-eclipse-plugin-test.zip (14 kB)



 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Yujin Kim added a comment - 03/Feb/05 02:55 PM
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.

  • yujin

Yujin Kim added a comment - 05/Feb/05 01:18 PM
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.


Yujin Kim added a comment - 05/Feb/05 01:19 PM
adding a test project i used to test the plugin patch.

Yujin Kim added a comment - 21/May/05 12:40 AM
uploading the patch for svn. (previous patch was based on cvs)

Yujin Kim added a comment - 21/May/05 12:46 AM
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.


Scott Lamb added a comment - 17/Jun/05 02:14 AM
There's another patch at http://issues.apache.org/jira/browse/AGILA-13 which I had some success with.

Yujin Kim added a comment - 17/Jun/05 03:20 AM
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.


Max Rudman added a comment - 05/Dec/05 09:48 PM
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="${nestedContext}" 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.