|Re: [m2e-users] m2e plugin 1.0 bug|
I have issues related to Workspace Resolution enabled in Eclipse.
Hope someone can help.
If I understand correctly, workspace resolution enabled means projects don't have to be installed in the local repository to relate to one another.
Eclipse Indigo (3.7.2)
Eclipse IDE 1.4.2
M2e Maven Integration for Eclipse 1.0.200
M2e Connector for build-helper-maven-plugin 0.14.0
Maven Integration for WTP 0.15.2
You can configure an eclipse project to resolve dependencies from a workspace. This has the effect of altering the way that Maven locates dependency artifacts. If a project is configured to resolve dependencies from the workspace, these artifacts do not need to be present in your local repository. Assume that project1 and project2 are both in the same Eclipse workspace, and that project1 (ex, a war project) depends on project2. If workspace resolution is disabled, the m2eclipse Maven build for project1 will only succeed if project2's artifact is present in the local repository. If workspace resolution is enabled, m2eclipse will resolve the dependency via the eclipse workspace. In other words, when workspace resolution is enabled, projects don't have to be installed in the local repository to relate to one another.
But for the later, that’s not the case.
For transitive dependencies (e.g project1 depends on both project2 and project3, and project2 depends on project3) make sure that ‘workspace resolution’ is enabled for all projects inside the workspace, else we get unpredictable results: http://jira.codehaus.org/browse/MECLIPSE-348
Now let’s perform the following set of commands through the eclipse IDE to test what mentioned above
Results obtained are given below.
- Workspace Resolution Enabled (cases 2 and 4) or not (cases 1 and 3) on all related projects (fig 1.1)
- ‘Run As > Maven Clean’ on project1 and project2
- Remove projects from your local Tomcat wtpwebapps and from local maven.repo
- ‘Maven > update dependencies…’ on project1
- Refresh on project1
- Right click on your Tomcat server instance in Eclipse and do ‘clean tomcat work directory’ and then ‘clean’. The later should republish your resources as well.
- Start Tomcat
Workspace Resolution OFF Workspace Resolution ON
(1) OK (2) OK
And publish to Tomcat doesn’t work
But publish to Tomcat works fine
OK: successful deployment of war to tomcat and application runs normally
NO: build errors
The key thing here is that case (4) should have started normally but fails at step 6.
When we compare the directory structures of case (1) and (4), we notice that it’s all messed up and that all ‘.class’ files are missing, which is in fact normal since we didn’t do a ‘maven build/install/package’ of the dependent projects(fig 1.2).
This is in fact an existing bug in Eclipse, but might be deprecated?
A version downgrade/upgrade of m2e doesn’t work either. I tried to migrate from m2eclipse to m2e, no luck. (as done here: http://blog.frankel.ch/migrating-from-m2eclipse-to-m2e)
https://issues.sonatype.org/browse/MNGECLIPSE-1755 [notice the creation date, and it is still unresolved]
https://issues.sonatype.org/browse/MNGECLIPSE-1387 [notice the creation date, and it is still unresolved]
I was wondering if there are any solutions/workaround/recommendations to solve the bug for case 3 and 4 mentioned above?
Or, unless I missed it, a bug already exist for this?
Should I open a bug on https://bugs.eclipse.org/ for this?
Please help !!
Description: PNG image
Back to the top