Unfortunately, it’s hard to answer your question because there’s contradictions in what you’re requesting.
For example,
If you want the transitive dependencies of spring-boot-starter-actuator
excluded from the WAR, the WAR should only include two JAR files, aspectjweaver-1.9.2.jar
and spring-boot-starter-aop-2.1.4.RELEASE.jar
. The other 18 JARs listed in WEB-INF/lib
of your Blank-deps.war
file are transitive dependencies of spring-boot-starter-actuator
, so excluding these transitive dependencies is clearly not what you want.
Sure, but what it resolves is technically incorrect. Maven’s provided
scope is not transitive, and therefore spring-boot-starter-actuator
and its transitive dependencies do not impact your WAR file. You have exactly the WAR that would be created if org.springframework.boot:spring-boot-starter-aop:2.1.4.RELEASE
was listed as your only dependency.
However, eclipse is including org.springframework.boot:spring-boot-starter-aop:2.1.4.RELEASE
and all of its transitive dependencies on the compile and runtime classpaths in the IDE. This is not ideal because it means that you now have classes available in the IDE that might not be available when the WAR runs in the application container.
Gradle strives to more accurately model the domain of build automation. When what you have is correctly modeled, you’re going to get the correct results for the WAR and eclipse. The most important item for this is what JARs are actually being provided externally from the WAR file through the container? If it’s only the spring-boot-starter-actuator-2.1.4.RELEASE.jar
, you’re technically missing JARs that would be needed in the WAR. If it’s spring-boot-starter-actuator-2.1.4.RELEASE.jar
AND its transitive dependencies, you need less in the WAR. If it’s something in between, then that exact list is important. If there’s exclusions you want to make for other reasons, those are important too. The Gradle dependencies need to be configured with those details.