Gradle and Spring-bootRun can not find my class

A answer on Stackoverflow points me to the state that two projects who inherit each other are in different classloaders at runtime. Is that true? I thought this requires extra Java code. Why do gradle add extra code to my jars?

Gradle does not add extra code to your JARs. Spring Boot does though as the structure of a Spring Boot JAR is not natively supported (JARs within a JAR).

I don’t see anything in that answer that suggests the poster believes there are multiple classloaders. Rather, I think the poster believes that you are running the application from :classic, not :advanced as the error is exactly what would happen in that case. The answer is accurate if you were expecting it to succeed when running from :classic.

As far as your actual problem, I think you’ve left out critical information or incorrectly transposed what you have in your actual project when making your example as there are inconsistencies and modifications needed for it to actually run. Once in a runnable state, it works as expected when running :advanced, but fails with the error you mentioned when running :classic, which is exactly what it should do. With what you’ve provided, I don’t see any way to reproduce your problem when running :advanced:bootRun.