I have done the migration of the Spring Boot Application from 1.5.8 to 2.1.14-RELEASE and using gradle as a build script. I am using spring-boot-gradle-plugin and spring-boot-dependency-management plugins. In our spring boot project, we are creating multiple executable jar files by creating tasks for each jar as below
// During Migration changed from Jar to BootJar
task eurekaAppJar(type: BootJar) {
baseName = 'eurekaJar'
version = '0.0.1'
println sourceSets.main.output
manifest {
attributes 'Main-Class': "org.springframework.boot.loader.JarLauncher"
attributes 'Start-Class': "com.abc.abcCompany.service.eurekaApp.EurekaApplication"
attributes 'Implementation-Version': "001"
}
bootJar {
mainClassName = "com.abc.abcCompany.service.eurekaApp.EurekaApplication"
}
from(sourceSets.main.output) {
}
}
// During Migration changed from Jar to BootJar
task oAuthConfigJar(type: BootJar) {
baseName = 'oAuthConfigJar'
version = '0.0.1'
manifest {
attributes 'Main-Class': "org.springframework.boot.loader.JarLauncher"
attributes 'Start-Class': "com.abc.abcCompany.service.authserver.AuthServerApplication"
attributes 'Implementation-Version': "001"
}
springBoot {
mainClassName = "com.abcCompany.service.authserver.AuthServerApplication"
}
from(sourceSets.main.output) {
}
}
// During migration changed from BootRepackage to BootJar
task eurekaBoot(type: BootJar, dependsOn: eurekaAppJar) {
mainClassName = 'com.abc.abcCompany.service.eurekaApp.EurekaApplication'
// During migration commented the below code
// customConfiguration = "eurekaconfiguration"
// withJarTask = eztrackerEurekaJar
}
// During migration changed from BootRepackage to BootJar
task oAuthConfigJarBoot(type: BootJar, dependsOn: oAuthConfigJar) {
println " Executing eztrackerApiGatewayBoot task"
mainClassName = 'com.abc.abcCompany.service.authserver.AuthServerApplication'
// During migration commented the below code
// customConfiguration = "zuulconfiguration"
// withJarTask = eztrackerApiGatewayJar
}
bootJar.dependsOn = [eurekaBoot, oAuthConfigJarBoot]
bootJar.enabled = false
In the above code after executing either gradle assemble, It has created two executable jar files eurekaJar-0.0.1.jar, oAuthConfigJar-0.0.1.jar.
Here is my question:
Before the spring boot migration, in the above jars the folder structure is as below:
eurekaJar-0.0.1.jar
-- org
-- META-INF
-- BOOT-INT
-- lib
-- dependencies (jars)
-- classes
-- applicationclasses
after the migration below is the folder structure
eurekaJar-0.0.1.jar -- org -- META-INF -- applicationclasses
so after the migration there is no BOOT-INF folder and dependencies(lib folder)
Because of the above issue my executable jar is not running.
Any comment is appreciated.