【发布时间】:2020-04-16 09:21:46
【问题描述】:
我正在处理一些具有以下版本的遗留代码:
- Gradle 4.10.2
- Spring Boot 1.5.16.RELEASE
当我执行assemble 任务时,我期望使用implementation 依赖配置指定的任何依赖都将放在Spring Boot fat jar 中。但是它们不是。
我现在使用已弃用的 compile 依赖配置,但我对为什么 implementation 不起作用感到困惑。
简体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'
}
在上面的示例中,当我执行 assemble Gradle 任务时,我希望将 commons-lang3-3.10.jar 放入胖 jar 中。它没有!
【问题讨论】:
标签: java spring spring-boot gradle