Ensure consistent ordering of jars on classpath #7
Description
Spring Boot users have had issues with the order that jar files are added to the classpath, and inconsistencies between this order when the app is run in various ways - e.g. from a fat jar archive or from an exploded archive. Spring Boot 2.3.0 addresses this by writing a classpath index file that specifies the order that jars should be loaded and modifying the Boot JarLauncher
to use this file when building the claspath.
This buildpack should attempt to use the same classpath ordering when enough information is provided to do so. This could be done in one of two ways:
The buildpack could look for a classpath index in the jar manifest (i.e. Spring-Boot-Classpath-Index: BOOT-INF/classpath.idx
) and use that information when building a classpath for use when starting the app via Start-Class
. The buildpack should implement the same ordering rules as JarLauncher
: classes, jar files on the file system that are not mentioned in classpath.idx
, and jar files from classpath.idx
.
Alternatively, the buildpack could start the app using JarLauncher
named by Main-Class
and avoid building a classpath altogether. This approach has the benefit of reducing complexity in the buildpack and avoiding the duplication of classpath ordering rules between the buildpack and JarLauncher
.