Open mauromol opened 5 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?
I have a multiproject build. Assume this structure:
Project
web
applieswar
andeclipse-wtp
plugins and is a WTP Dynamic Web Project. Projectutil
appliesjava
andeclipse-wtp
plugins and is a WTP Utility Project.Project
util
has a compile dependency againstorg.springframework:spring-orm:4.3.11.RELEASE
, which transitively brings a compile dependency againstorg.springframework:spring-jdbc:4.3.11.RELEASE
. It also has a compile dependency against another library that would transitively bringorg.springframework:spring-jdbc:3.0.7.RELEASE
, but this is upgraded to 4.3.11.RELEASE.Project
web
has a compile dependency against projectutil
, and hence it has transitively the same compile dependency againstorg.springframework:spring-jdbc:4.3.11.RELEASE
. However, projectweb
also declares a runtime dependency againstorg.springframework.integration:spring-integration-jdbc:4.3.18.RELEASE
, which transitively brings a runtime dependency onorg.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:
web
, the Project and External Dependencies classpath container contains both spring-jdbc-4.3.11.RELEASE.jar and spring-jdbc-4.3.18.RELEASE.jar (WRONG: I would expect to see only spring-jdbc-4.3.11.RELEASE.jar here, which is the compile dependency; I suspect that some limitations of the Eclipse model may require to put spring-jdbc-4.3.18.RELEASE.jar here, but in any case, I wouldn't expect to find them both)web
to a Tomcat server with WTP, in the deployed directory I find only spring-jdbc-4.3.18.RELEASE.jar (CORRECT: this is exactly what I expect and is coherent with thewar
task output)