salesforce / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar
BSD 3-Clause "New" or "Revised" License
226 stars 49 forks source link

Add support for Spring Boot 3.2.0 NestedFileSystemProvider #176

Closed hjellek closed 8 months ago

hjellek commented 8 months ago

Spring Boot 3.2.0 Introduces nested jars support, with a new NestedFileSystemProvider. This is not automatically loaded into the resulting jar with the current implementation.

It seems like META-INF/services/java.nio.file.spi.FileSystemProvider is not loaded into the resulting jar when packaged.

When inspecting the jar, META-INF only contains the MANIFEST.MF file:

META-INF/
META-INF/MANIFEST.MF

while a similiar example with Maven correctly has the META-INF/services/java.nio.file.spi.FileSystemProvider file correctly packaged

META-INF/
META-INF/MANIFEST.MF
META-INF/services/
META-INF/services/java.nio.file.spi.FileSystemProvider

See https://github.com/hjellek/rules_spring/blob/spring-boot-3.2.1-example/examples/helloworld/src/test/java/com/sample/SampleNesteFileSystemUnitTest.java as a simple/naive example of the error.

One workaround for now is to use the spring-boot-loader-classic which results in usage of the old file loader, which does not produce resources with the jar:nested: property.

plaird commented 8 months ago

OK, thanks for pointing this out.

hjellek commented 8 months ago

Thanks for such a fast response!