3

adding Cloud SDK like this for CF: compile "com.sap.cloud.s4hana:s4hana-all:${cloudSDKVersion}" compile ("com.sap.cloud.s4hana.cloudplatform:scp-cf:${cloudSDKVersion}") leads to duplicate jars in spring boot jar which is deployed to CF. examples: core-2.3.1.jar connectivity-2.3.1.jar

  • This leads to :
    • ClassNotFoundExceptions during runtime
    • prevents cf push commands with error: Comparing local files to remote cache... Aborting push: File BOOT-INF/lib/core-2.3.1.jar has been modified since the start of push. Validate the correct state of the file and try again. FAILED

1 Answers1

5

gradle skips the component name when building the boot package.

After some googling around this was the solution: https://github.com/spring-projects/spring-boot/issues/10778

bootJar {
    rootSpec.filesMatching('**/*.jar', { jar ->
        String groupId = jar.file.parentFile.parentFile.parentFile.parentFile.name
        jar.name = "$groupId-${jar.name}"
    })
}
Christoph Schubert
  • 1,089
  • 1
  • 8
  • 16