This is a follow on from #9128 to consider whether or not we want the same functionality for war files.

Comment From: stategen

Yes, I have the same problem with springboot-2.3. x. when I rewrite class with the same name and package, I get new class when I test in eclipse. But when it packaged and run , spring boot loads the class in dependence jar and ignores new class, even though it is in WEB-INF/classes folder.

I think it should be compatible with the order of tomcat's classloader, because most of the old projects were originally running in tomcat or orther java container, otherwise upgrading to spring boot will bring bugs that are difficult to test

Comment From: wilkinsona

@stategen How are you running your application? This issue is only relevant if you are unzipping a war file and then running it with something like java -cp . org.springframework.boot.loader.WarLauncher. When a war file is run using java -jar, classes in WEB-INF/classes should already be preferred over classes in the jars in WEB-INF/lib. If you're using java -jar and that's not happening then please open a new issue with a minimal sample that reproduces the problem.

Comment From: scottfrederick

The Paketo Spring Boot buildpack expects a classpath index file in a jar or war when building a native image in order to get a predictable classpath at native image build time. The absence of a classpath index in a war file currently causes an error in the buildpack. It would be good for the buildpack to be able to treat jar and war files consistently, so this enhancement would be beneficial.

Comment From: wilkinsona

Given the above, this sounds like a good thing to address in 2.7.