|
Versions usedEclipse 3.3.1 for both Linux and Windows. Further considerationI got the very same issue reported here, on both Linux and Windows platforms. I played a bit further with project properties and created different types of WTP projects:
All these projects have exactly the same .project files (but, of course, project name) with the same builders. Interestingly enough, the only project that cannot resolve artifacts corresponding to open projects is the web module one. Playing with installed facets (for example removing Web facet and adding Utility one) does not change anything to the problem. However changing the owning artifact package does the trick! If you simply switch package type from "war" to "jar" in the Web module pom.xml (even if it does not make sens Test caseSo here is the test case:
There is obviously an issue with handling of "war" projects combined with facets... CriticityAs of me, this bug is a really serious one. Working on a Web project using multiple artifacts/Eclipse project makes me opening, closing and installing artifacts all the time in order to make the web-app project compile with latest changes from depending modules. A bug fix would be truly appreciated Oliver, can you please attach your test projects to this issue. Thanks.
This file
Import these trwo projects into your workspace. TestWar should not compile and TestJar should not be included in its Maven depencies. This last fact signifies you can work almost normally by changing the Web modules from "war" to another type of packaging but this workaround is really dangerous as you could put an incorrectly typed pom.xml in your control version system and generate bad applications. We've also run into this issue, now.
We want to integrate a maven project with packaging war with Eclipse dynamic web project. As the last comment states, when you change packaging in the pom.xml from war to jar, the dependencies are resolved from workspace. (with packaging war not). But, we also want to use the "Run on Server" feature of WTP, so we'd like to publish the project via WTP to the configured tomcat instance. Holger, we also have run across that issue. Until m2eclipse fixes it, our current work-around is to create source links (Project Properties -> Java Build Path -> Source -> Link Source) to the dependency projects. That does the trick pretty nicely.
The WTP integration article on the Wiki (http://docs.codehaus.org/display/M2ECLIPSE/Integration+with+WTP
Unfortunately my dependency projects don't show on that list, and there's no "Add Project" button :/
Also the J2EE Module Dependencies workaround from the Wiki, does not work for Eclipse features that do not use WTP. For example, launching JUnits.
fixed. workspace dependencies should resolve properly now and wtp's "j2ee module dependencies" should be updated automatically.
I'm still seeing this bug. I'll attach a stripped out version from Oliver's test case.
How to reproduce: Reopening and cleaning the projects doesn't help. If I turn off workspace resolution, the project builds fine in eclipse. Am I doing something wrong or should this work? Edit: I'm using m2eclipse 0.9.4.20080521-2330 and Eclipse 3.3.2 with latest patches available from update site. Not sure if this has effect, but I tested with both embedded installation and Maven 2.0.9. Edit2: Added wtpversion to TestWar. Additionally, I see the following exception in error log: Edit3: facets seem to get added ok. Test case, see my comment.
Bugittaa, Maven Projects import wizard (File->Import->General->Maven Projects) is the only supported way to import new WAR projects into m2eclipse and I verified that it works for your test projects. Please open new issue report if you still have problems after using this import wizard.
Bugittaa, to clarify, you do not need to use maven-eclipse-plugin, with m2eclipse 0.9.4 everything should work out of the box, so correct/supported steps to import your test projects are
Results, TestWar has proper j2ee module dependency on TestJar and both projects build without errors in eclipse. is the fixed version available online?
my eclipse uses this update site: http://m2eclipse.sonatype.org/update/ it has the version 0.9.3.20080421-2352 and says there are no updates. Is it ok? Is it the same as 0.9.4? m2eclipse 0.9.4 weekly builds are available from http://m2eclipse.sonatype.org/update-dev/
Thanks Igor. I tried maven project import. Some findings:
For the first thing listed, I'll have to investigate more. For the last two, should I submit a feature requests (checked JIRA and didn't find anything related)? yes, please open separate jira for each problem. sample project and steps to reproduce will let us provide fixes faster.
As I can see, in versions 0.9.5 and 0.9.7.200810211352 (last one available in dev update site as of today), this issue is still here :
In any project, if I set packaging option to "war" in the pom.xml, none of the dependencies available in the workspace are resolved. If I change the packaging option to "jar", all of them are correctly resolved. Michael, after changing packaging in your pom.xml you may have to run Maven / Update project configuration in order to align project properly with WTP. You also need to make sure that m2eclipse WTP integration feature is installed.
I can confirm that I am quite successfully deploying a war project along with it's dependency which is an open project in my workspace - i.e. works for me
Are you running Ganymede? I'm seeing this problem in Ganymede with the latest version.
If I go to Project->Properties->Java EE Module Dependencies and manually check the projects, it works. The "Maven Dependencies" dependency shows up in this list but somehow it's not being linked to the projects at runtime. I have to manually re-check these each time I do "Update Project Configuration" or "Update Dependencies". omg - a year later and i hit the same issue! (a year after my original issue -
I had to manually add the transitive dependency to the project under Java EE Modules as Ryan described. Antony, this is not enough information. Please open new jira issue, specify version of m2eclipse, attach your Eclipse configuration details from Help / About Eclipse SDK / Configuration Details and test project that would allow us to reproduce. Please also note that there is significant improvements in 0.9.7 dev builds related to Java EE / WTP support, so you may want to try it first.
oh, no believe me i know that's not enough information - my intention was not to fix it, just to raise suspicion
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MNGECLIPSE-105.