6

I have a simple hello world spring 2 boot app, which runs with full JDK 13. Now I am trying to get this to run with a custom JRE using spring boot.

In past when I have need external jars, I have run jdeps -s json-20190722.jar to see what modules I need.

$jdeps -s json-20190722.jar 
json-20190722.jar -> java.base

But when I do this with Spring I get

$jdeps -s spring-boot-2.2.4.RELEASE.jar
spring-boot-2.2.4.RELEASE.jar -> java.base
spring-boot-2.2.4.RELEASE.jar -> java.desktop
spring-boot-2.2.4.RELEASE.jar -> java.logging
spring-boot-2.2.4.RELEASE.jar -> java.management
spring-boot-2.2.4.RELEASE.jar -> java.naming
spring-boot-2.2.4.RELEASE.jar -> java.sql
spring-boot-2.2.4.RELEASE.jar -> java.xml
spring-boot-2.2.4.RELEASE.jar -> not found

It also fails when I do

$ jdeps --generate-module-info . spring-boot-2.2.4.RELEASE.jar | more
Missing dependence: ./spring.boot/module-info.java not generated
Error: missing dependencies
spring.boot
   org.springframework.boot.Banner                    -> org.springframework.core.env.Environment           not found
   org.springframework.boot.BeanDefinitionLoader      -> groovy.lang.Closure                                not found

What am I missing here?

Thank you

ghjghgkj
  • 373
  • 1
  • 3
  • 9

1 Answers1

7

You need also all your dependencies and point it in class path option.

$jdeps -R -s --multi-release 13 -cp 'path-to-dependencies/*' your-app.jar

You can find all dependencies if you extract your fat jar (see The Executable Jar File Structure):

 jar -xvf your-jar-file.jar

Or retrieve them with Gradle and custom task:

task copyDependencies(type: Copy) {
    from configurations.default
    into 'build/libs/dependencies'
}
Denis.E
  • 323
  • 2
  • 10