Override classes present in Spring Boot fat jar with classes in external jar present in loader.path

35 Views Asked by At

I am shipping a base docker image to customer with a Spring boot jar file app.jar.

Now, here is my Dockerfile entrypoint: ENTRYPOINT [ "java", "-cp", "app.jar", "-Dloader.path=/external/classpath","org.springframework.boot.loader.PropertiesLauncher"]

The client can replace n number of classes from the main application and create a client.jar file with those with same package and class name.

Now, they will create a layer on top of the base image and add client.jar to /external/classpath folder.

How do I ensure the classes from client.jar are loaded by the ClassLoader instead of the classes from app.jar BOOT-INF/classes folder?

0

There are 0 best solutions below