Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 (.NET CLR 3.5.30729) Build Identifier: 20090920-1017 This bug doesn't occur in eclipse 3.4.2. Dependencies shouldn't be duplicated in the classpath. Those dependencies are computed in the JavaProject>>resolveClasspath(**) and added to the "resolvedEntries" in JavaProject>>addToResult(**). The statement resolvedEntries.add(resolvedEntry) should be conditionned to testing against a previous entry. Therefore the function becomes : if (result.rawReverseMap.get(resolvedPath = resolvedEntry.getPath()) == null) { result.rawReverseMap.put(resolvedPath, rawEntry); result.rootPathToResolvedEntries.put(resolvedPath, resolvedEntry); resolvedEntries.add(resolvedEntry); } This bug leads to a wrong JavaModelManager.PerProjectInfo per project, leading for instance to a wrong publishing of that project. In case of using m2eclipse, this leads to classloading issues when you want to develop an entreprise application, using webapplication, ejb and utility modules shared between those. Reproducible: Always Steps to Reproduce: 1.create an EAR application having one webapplication module 2.use m2eclipse to deal with dependencies 3.add one dependency to ear and war, tag it "optional" in the latest. 4.publish the project The dependency is duplicated between ear and war/WEB-INF/lib
Jay, please investigate.
The fix for this will be provided along with bug 252431.
Created attachment 159347 [details] Patch with test Decoupled the fix for this bug from patch with bug 252431 comment 25. Olivier, could you review please?
An additional note about the patch - earlier we would allow multiple library entries with same path depending on their other attributes, such as optional, source attachment path etc. But with this patch, when there are entries with the same path, we add only the first entry to the resolved classpath.
That sounds ok to me. If this is the same library, why would the user set different source or javadoc attachments? I'll review the patch today.
Patch looks ok.
Released in HEAD for 3.6M6.
Verified for 3.6M6 using build I20100305-101
Verified.