簡體   English   中英

使用Gradle應用程序插件使用重新打包的Spring Boot jar創建發行版

[英]Creating distribution with repackaged spring boot jar using gradle application plugin

是否可以將gradle的應用程序插件配置為僅包含重新包裝的spring boot jar(通過boot gradle plugin )和其他資源(例如啟動腳本),而不包含其他依賴項jar(因為它們已經由boot gradle插件重新包裝)?

使用spring-boot-gradle-plugin,這是一個build.gradle示例:

ext {
    mainClassName = 'com.x.x'
}

springBoot {
    mainClass = 'com.x.x'
    layout = 'ZIP'
}

task generateExecutableJar(type: Jar) {
    appendix = 'boot'
    from sourceSets.main.output
}

task repackage(type: BootRepackage, dependsOn: generateExecutableJar) {
    executable = true
    customConfiguration = 'customDependencies'
    withJarTask = generateExecutableJar
}

configurations {
    customDependencies
}

暫無
暫無

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

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