Skip to content

spring-boot-maven-plugin repackage uber jar execution fails when jar is put on WSL network drive #38956

@pdeneve

Description

@pdeneve

When the uber jar created with spring-boot-maven-plugin:3.2.1 (repackage goal) is put on a WSL (Windows subsystem for Linux) network drive, the following error is emitted when running the jar:

$ java -jar \\wsl$\debian\spring-boot_3.2.1-uber-jar-issue-0.0.1.jar
Exception in thread "main" java.lang.ClassNotFoundException: be.pdn.issue.sbmp.Main
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
        at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:104)
        at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:534)
        at java.base/java.lang.Class.forName(Class.java:513)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:88)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)

This is not the case when the uber jar is created with spring-boot-maven-plugin:3.1.7

$ java -jar \\wsl$\debian\spring-boot_3.1.7-uber-jar-issue-0.0.1.jar
If you see this it works

As a workaround it is possible to set CLASSIC in spring-boot-maven-plugin, see release notes for details.

Tested on Windows 11 with Java 21. Example project to reproduce: spring-boot-uber-jar-issue.tar.gz.

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions