BootJar not bundling all the dependencies including static files

190 views Asked by At

I'm working on Gradle 7 able run my spring-boot app with eclipse and trying to create executable jar with all dependencies to run with java -jar command but I'm not able to achieve it and I'm new to gradle.What is needed to be added or changed in my build.gradle to do so.I had attached the snapshot of my build.gradle below.

project structure: c-viewer +----c-app,build.gradle +------c-app-ui,build.gradle

build.gradle of c-app

println "Main deploy folder: ${appDeployFolder}"
subprojects{
apply plugin: 'io.spring.dependency-management'
apply plugin: "java"
apply from: "${project(':c-app').projectDir}/copyStatic.gradle"
apply from: "${project(':c-app').projectDir}/deployApp.gradle"
deployApp.enabled = true
copyStaticHtml.enabled = false
//findMainClass.enabled = true
dependencies{
implementation project(":chv-lib:chv-lib-config")
implementation("de.codecentric:spring-boot-admin-starter-client")
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'  
implementation 'org.springframework.boot:spring-boot-starter' //added dependency
}
bootJar {
enabled = true
mainClassName = 'com.am.c.Application'
}
}
0

There are 0 answers