I would like to run a Spring Boot application with an extra file (happens to be a css) being on the classpath. I can't touch the jar (the application itself). I can only modify the start script.
I've received a start script with the application::
#! /bin/sh
commandline="java -jar xxx-1.0.0.jar"
commandline="$commandline --spring.config.location=../config/xxx.properties"
commandline="$commandline --logging.config=../config/log4j2.xml"
$commandline
My naive first try was adding a folder with -cp and put the file into that folder. However that is not working because -cp and -jar is not compatible ( nice explanation here: Differences between "java -cp" and "java -jar"? )
Then I found suggestions for using PropertiesLauncher + loader.path which can be seen as a replacement for classpath on the command line ( https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#executable-jar-property-launcher-features ) . However to use PropertiesLauncher the examples suggested modifying the pom, which I can't do ( Spring Boot: Is it possible to use external application.properties files in arbitrary directories with a fat jar? )
What I can do is modifying the shell script.
How should I (if it is possible at all) put the extra file onto the classpath without modifying the Spring Boot application?