eclipse / buildship

The Eclipse Plug-ins for Gradle project.
533 stars 171 forks source link

WTP: wrong dependency conflict resolution in "Project and External Dependencies" container and in Launch Configuration Source tab when runtime dependency upgrades a compile dependency #883

Open mauromol opened 5 years ago

mauromol commented 5 years ago

I have a multiproject build. Assume this structure:

Project web applies war and eclipse-wtp plugins and is a WTP Dynamic Web Project. Project util applies java and eclipse-wtp plugins and is a WTP Utility Project.

Project util has a compile dependency against org.springframework:spring-orm:4.3.11.RELEASE, which transitively brings a compile dependency against org.springframework:spring-jdbc:4.3.11.RELEASE. It also has a compile dependency against another library that would transitively bring org.springframework:spring-jdbc:3.0.7.RELEASE, but this is upgraded to 4.3.11.RELEASE.

Project web has a compile dependency against project util, and hence it has transitively the same compile dependency against org.springframework:spring-jdbc:4.3.11.RELEASE. However, project web also declares a runtime dependency against org.springframework.integration:spring-integration-jdbc:4.3.18.RELEASE, which transitively brings a runtime dependency on org.springframework:spring-jdbc:4.3.18.RELEASE.

The net effect is that, if I call gradle web:war in WEB-INF/lib I get spring-jdbc-4.3.18.RELEASE.jar, because the 4.3.11.RELEASE compile dependency is upgraded to 4.3.18.RELEASE. So far so good.

However, what I see in Eclipse is this:

mauromol commented 2 years ago

Today I hit again this problem, which I removed from my memory, and then discovered I had already reported it back in 2019 :-) I'm using Eclipse 2021-12 and Buildship 3.1.5.v20210113-0929 now.

Any hope you can look at this? It's a source of many headaches indeed. If there are limitations from Eclipse to handle this properly, perhaps a less problematic approach could be tried, at least to avoid the duplicate JARs in build path problem?