[英]Dependencies specified with `implementation` configuration in Gradle build not put into Spring Boot fat jar
I'm working on some legacy code with the following versions:我正在使用以下版本处理一些遗留代码:
I was expecting that any dependencies I specify with the implementation
dependency configuration would be placed in the Spring Boot fat jar when I execute the assemble
task.当我执行
assemble
任务时,我期望使用implementation
依赖项配置指定的任何依赖项都将放在 Spring Boot fat jar 中。 However they are not .然而他们不是。
I've resorted to using the deprecated compile
dependency configuration for now, but I'm confused as to why implementation
doesn't work.我现在已经使用了不推荐使用的
compile
依赖配置,但我对为什么implementation
不起作用感到困惑。
Simplified build.gradle
is as follows:简化的
build.gradle
如下:
plugins {
id 'java'
id "org.springframework.boot" version "1.5.16.RELEASE"
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.apache.commons:commons-lang3:3.10'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
In the example above, I would have expected commons-lang3-3.10.jar
to be put inside the fat jar when I execute the assemble
Gradle task.在上面的示例中,当我执行
assemble
Gradle 任务时,我希望将commons-lang3-3.10.jar
放入胖 jar 中。 It does not!它不是!
The most likely explanation is that this version of the Spring boot plugin did not support the reworked configurations of the Gradle java
plugins.最可能的解释是,这个版本的 Spring 引导插件不支持 Gradle
java
插件的重新设计配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.