簡體   English   中英

在 Gradle 構建中使用“實現”配置指定的依賴項未放入 Spring 引導胖 jar

[英]Dependencies specified with `implementation` configuration in Gradle build not put into Spring Boot fat jar

我正在使用以下版本處理一些遺留代碼:

  • Gradle 4.10.2
  • Spring 啟動 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 中。 它不是!

最可能的解釋是,這個版本的 Spring 引導插件不支持 Gradle java插件的重新設計配置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM