Update `Path` creation for nested locations to allow both UNC and classic
file references to be used. This commit attempts to align our URL
handling with that of standard file URLs. The `NestedLocation` class
no longer attempts to remove leading all `\` characters and instead
only removes the first `\` when the second char is `:`. This duplicates
the logic found in Java's own internal `WindowsUriSupport` class which
is used when calling `Path.of(url)` with a `file:` URL.
Fixes gh-40549
In order to support Java 22, we must use spring-core 6.1.x.
spring-core 6.1.x is a multi-release jar so, in order to support Java
22, a version of Gradle that supports multi-release jars must be
used.
This commit adds a new variant to spring-boot-gradle-plugin for
modern versions of Gradle. When Gradle's plugin API version is 8.7 or
later, we use spring-core 6.1.x. spring-core 6.0.x is used at all
other times.
Closes gh-40074
* pr/40603:
Polish "Change Spring Boot CLI init command docs default build system to gradle"
Change Spring Boot CLI init command docs default build system to gradle
Closes gh-40603
Fix regression in `JarUrlConnection` where a NullPointerException could
be thrown internally causing performance issues.
When the SecurityManager is present, the following stack trace is
thrown:
java.lang.NullPointerException: Cannot invoke "java.net.URLConnection.getPermission()" because "this.jarFileConnection" is null
at org.springframework.boot.loader.net.protocol.jar.JarUrlConnection.getPermission(JarUrlConnection.java:175)
at java.base/jdk.internal.loader.URLClassPath.check(URLClassPath.java:553)
at java.base/jdk.internal.loader.URLClassPath$Loader.findResource(URLClassPath.java:612)
at java.base/jdk.internal.loader.URLClassPath.findResource(URLClassPath.java:296)
at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:629)
at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:627)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.net.URLClassLoader.findResource(URLClassLoader.java:626)
at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.findResource(JarUrlClassLoader.java:70)
at java.base/java.lang.ClassLoader.getResource(ClassLoader.java:1403)
at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:290)
at java.base/java.lang.Class.getResourceAsStream(Class.java:2850)
See gh-39856
The diagnostics text include the name of the AOT initializer class and
the main class name. It also tells the user how to switch of the AOT
mode.
Closes gh-38645