A project with only Spring Native (can be created from start.spring.io) breaks the layertools jar mode:

$ java -Djarmode=layertools -jar target/demo-0.0.1-SNAPSHOT.jar
Unsupported jarmode 'layertools'

Comment From: wilkinsona

The problem is that the layer tools' spring.factories entries are missing from AOT-generated static Spring factories. I think they're missing as the way that the layer tools jar is added to the fat jar makes it invisible to the AOT support. The problem occurs with both Maven- and Gradle-built jars.

Comment From: philwebb

Any ideas on how we can fix this? Is it really a boot issue or something that Spring Native needs to address?

Comment From: snicoll

It kind of is a Spring Boot issue as Andy described. We're adding a resource in the application jar that has spring.factories but we're not declaring that anywhere so the AOT tool doesn't have a chance to process it.

This would go away once/if this capability is merged with the Spring Boot build plugins. In the meantime, we could maybe hardcode something in spring native itself. WDYT @bclozel?

Comment From: bclozel

I think we need to introduce a workaround in spring-native. I'm not sure we can consider this a bug, as nothing states that Spring Factories should be present at build time.

Comment From: philwebb

I'll close this one for now, but if we need additional changes to help spring-native detect layer tools we can reopen it.

Comment From: snicoll

I've created https://github.com/spring-projects-experimental/spring-native/issues/708 and added the relevant label to the issue.