diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/dockerfiles.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/dockerfiles.adoc index a3374debfa..1956cc4a31 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/dockerfiles.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/dockerfiles.adoc @@ -44,7 +44,7 @@ COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] ---- Assuming the above `Dockerfile` is in the current directory, your docker image can be built with `docker build .`, or optionally specifying the path to your application jar, as shown in the following example: diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/efficient-images.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/efficient-images.adoc index b7bfbdf9f1..d06327bb05 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/efficient-images.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/container-images/efficient-images.adoc @@ -28,8 +28,8 @@ The following shows an example of a `layers.idx` file: - BOOT-INF/lib/library1.jar - BOOT-INF/lib/library2.jar - "spring-boot-loader": - - org/springframework/boot/loader/JarLauncher.class - - org/springframework/boot/loader/jar/JarEntry.class + - org/springframework/boot/loader/launch/JarLauncher.class + - ... - "snapshot-dependencies": - BOOT-INF/lib/library3-SNAPSHOT.jar - "application": diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/efficient.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/efficient.adoc index 9064f844c7..5b8db54d37 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/efficient.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment/efficient.adoc @@ -13,7 +13,7 @@ One way to run an unpacked archive is by starting the appropriate launcher, as f [source,shell,indent=0,subs="verbatim"] ---- $ jar -xf myapp.jar - $ java org.springframework.boot.loader.JarLauncher + $ java org.springframework.boot.loader.launch.JarLauncher ---- This is actually slightly faster on startup (depending on the size of the jar) than running from an unexploded archive. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/executable-jar/launching.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/executable-jar/launching.adoc index a672c69634..481145b60a 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/executable-jar/launching.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/executable-jar/launching.adoc @@ -22,7 +22,7 @@ The following example shows a typical `MANIFEST.MF` for an executable jar file: [indent=0] ---- - Main-Class: org.springframework.boot.loader.JarLauncher + Main-Class: org.springframework.boot.loader.launch.JarLauncher Start-Class: com.mycompany.project.MyApplication ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc index 9aae568be3..5255d70381 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc @@ -132,7 +132,7 @@ The printed banner is registered as a singleton bean under the following name: ` The `${application.version}` and `${application.formatted-version}` properties are only available if you are using Spring Boot launchers. The values will not be resolved if you are running an unpacked jar and starting it with `java -cp `. -This is why we recommend that you always launch unpacked jars using `java org.springframework.boot.loader.JarLauncher`. +This is why we recommend that you always launch unpacked jars using `java org.springframework.boot.loader.launch.JarLauncher`. This will initialize the `application.*` banner variables before building the classpath and launching your app. ==== diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/build.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/build.adoc index 97c24447a6..cfae774a95 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/build.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/build.adoc @@ -290,7 +290,7 @@ The following example shows how to build an executable archive with Ant: - + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/main/resources/org/springframework/boot/ant/antlib.xml b/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/main/resources/org/springframework/boot/ant/antlib.xml index bf2f730786..3a0d4902d9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/main/resources/org/springframework/boot/ant/antlib.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/main/resources/org/springframework/boot/ant/antlib.xml @@ -61,7 +61,7 @@ + value="org.springframework.boot.loader.launch.JarLauncher" /> diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-cli/build.gradle index 35714e676f..db81bc3e80 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/build.gradle @@ -66,7 +66,7 @@ task fullJar(type: Jar) { } manifest { attributes( - "Main-Class": "org.springframework.boot.loader.JarLauncher", + "Main-Class": "org.springframework.boot.loader.launch.JarLauncher", "Start-Class": "org.springframework.boot.cli.SpringCli" ) } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/content/bin/spring.bat b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/content/bin/spring.bat index c9c0081c06..3bec928532 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/content/bin/spring.bat +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/content/bin/spring.bat @@ -59,7 +59,7 @@ set CMD_LINE_ARGS=%$ @rem Setup the command line set CLASSPATH=%SPRING_HOME%\lib\* -"%JAVA_EXE%" %JAVA_OPTS% -cp "%CLASSPATH%" org.springframework.boot.loader.JarLauncher %CMD_LINE_ARGS% +"%JAVA_EXE%" %JAVA_OPTS% -cp "%CLASSPATH%" org.springframework.boot.loader.launch.JarLauncher %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/executablecontent/bin/spring b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/executablecontent/bin/spring index 0e025b27d6..dda4e9b281 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/executablecontent/bin/spring +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/executablecontent/bin/spring @@ -115,4 +115,4 @@ if $cygwin; then fi IFS=" " read -r -a javaOpts <<< "$JAVA_OPTS" -exec "${JAVA_HOME}/bin/java" "${javaOpts[@]}" -cp "$CLASSPATH" org.springframework.boot.loader.JarLauncher "$@" +exec "${JAVA_HOME}/bin/java" "${javaOpts[@]}" -cp "$CLASSPATH" org.springframework.boot.loader.launch.JarLauncher "$@" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ForkProcessCommand.java b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ForkProcessCommand.java index a3c282faf4..eb2336d75c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ForkProcessCommand.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ForkProcessCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ import org.springframework.boot.loader.tools.JavaExecutable; */ class ForkProcessCommand extends RunProcessCommand { - private static final String MAIN_CLASS = "org.springframework.boot.loader.JarLauncher"; + private static final String MAIN_CLASS = "org.springframework.boot.loader.launch.JarLauncher"; private final Command command; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle index 2872469f60..6a1897ae3d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle @@ -10,7 +10,7 @@ tasks.named("bootWar") { // tag::properties-launcher[] tasks.named("bootWar") { manifest { - attributes 'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher' + attributes 'Main-Class': 'org.springframework.boot.loader.launch.PropertiesLauncher' } } // end::properties-launcher[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts index 19d723b795..f5284eb8f2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts @@ -12,7 +12,7 @@ tasks.named("bootWar") { // tag::properties-launcher[] tasks.named("bootWar") { manifest { - attributes("Main-Class" to "org.springframework.boot.loader.PropertiesLauncher") + attributes("Main-Class" to "org.springframework.boot.loader.launch.PropertiesLauncher") } } // end::properties-launcher[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index 7a39e10bfb..921e9f3d48 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -61,9 +61,9 @@ class BootArchiveSupport { static { Set defaultLauncherClasses = new HashSet<>(); - defaultLauncherClasses.add("org.springframework.boot.loader.JarLauncher"); - defaultLauncherClasses.add("org.springframework.boot.loader.PropertiesLauncher"); - defaultLauncherClasses.add("org.springframework.boot.loader.WarLauncher"); + defaultLauncherClasses.add("org.springframework.boot.loader.launch.JarLauncher"); + defaultLauncherClasses.add("org.springframework.boot.loader.launch.PropertiesLauncher"); + defaultLauncherClasses.add("org.springframework.boot.loader.launch.WarLauncher"); DEFAULT_LAUNCHER_CLASSES = Collections.unmodifiableSet(defaultLauncherClasses); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java index 2b2d1cfa2e..5cf51bb850 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java @@ -49,7 +49,7 @@ import org.gradle.work.DisableCachingByDefault; @DisableCachingByDefault(because = "Not worth caching") public abstract class BootJar extends Jar implements BootArchive { - private static final String LAUNCHER = "org.springframework.boot.loader.JarLauncher"; + private static final String LAUNCHER = "org.springframework.boot.loader.launch.JarLauncher"; private static final String CLASSES_DIRECTORY = "BOOT-INF/classes/"; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java index 47ce5f0c54..d697f00a1e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java @@ -48,7 +48,7 @@ import org.gradle.work.DisableCachingByDefault; @DisableCachingByDefault(because = "Not worth caching") public abstract class BootWar extends War implements BootArchive { - private static final String LAUNCHER = "org.springframework.boot.loader.WarLauncher"; + private static final String LAUNCHER = "org.springframework.boot.loader.launch.WarLauncher"; private static final String CLASSES_DIRECTORY = "WEB-INF/classes/"; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java index 1b1a653168..187c42fb69 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java @@ -166,7 +166,7 @@ class PackagingDocumentationTests { assertThat(file).isFile(); try (JarFile jar = new JarFile(file)) { assertThat(jar.getManifest().getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.PropertiesLauncher"); + .isEqualTo("org.springframework.boot.loader.launch.PropertiesLauncher"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java index f4eceac89a..17623f9ed4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java @@ -270,7 +270,9 @@ abstract class AbstractBootArchiveTests { void loaderIsWrittenToTheRootOfTheJarWhenUsingThePropertiesLauncher() throws IOException { this.task.getMainClass().set("com.example.Main"); executeTask(); - this.task.getManifest().getAttributes().put("Main-Class", "org.springframework.boot.loader.PropertiesLauncher"); + this.task.getManifest() + .getAttributes() + .put("Main-Class", "org.springframework.boot.loader.launch.PropertiesLauncher"); try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("org/springframework/boot/loader/LaunchedURLClassLoader.class")).isNotNull(); assertThat(jarFile.getEntry("org/springframework/boot/loader/")).isNotNull(); @@ -362,7 +364,7 @@ abstract class AbstractBootArchiveTests { assertThat(jarFile.getManifest().getMainAttributes().getValue("Main-Class")) .isEqualTo("com.example.CustomLauncher"); assertThat(jarFile.getManifest().getMainAttributes().getValue("Start-Class")).isEqualTo("com.example.Main"); - assertThat(jarFile.getEntry("org/springframework/boot/loader/LaunchedURLClassLoader.class")).isNull(); + assertThat(jarFile.getEntry("org/springframework/boot/loader/launch/LaunchedClassLoader.class")).isNull(); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java index 5355e1ba79..2cbe89cf57 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; class BootJarTests extends AbstractBootArchiveTests { BootJarTests() { - super(BootJar.class, "org.springframework.boot.loader.JarLauncher", "BOOT-INF/lib/", "BOOT-INF/classes/", + super(BootJar.class, "org.springframework.boot.loader.launch.JarLauncher", "BOOT-INF/lib/", "BOOT-INF/classes/", "BOOT-INF/"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java index e53080ca77..8728298b49 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java @@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; class BootWarTests extends AbstractBootArchiveTests { BootWarTests() { - super(BootWar.class, "org.springframework.boot.loader.WarLauncher", "WEB-INF/lib/", "WEB-INF/classes/", + super(BootWar.class, "org.springframework.boot.loader.launch.WarLauncher", "WEB-INF/lib/", "WEB-INF/classes/", "WEB-INF/"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle index d4fb21f8c9..c0139a8a97 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle @@ -21,5 +21,5 @@ task explode(type: Sync) { task launch(type: JavaExec) { classpath = files(explode) - mainClass = 'org.springframework.boot.loader.JarLauncher' + mainClass = 'org.springframework.boot.loader.launch.JarLauncher' } \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java index 61586d3d1c..82c73ef859 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ public final class Layouts { @Override public String getLauncherClassName() { - return "org.springframework.boot.loader.JarLauncher"; + return "org.springframework.boot.loader.launch.JarLauncher"; } @Override @@ -108,7 +108,7 @@ public final class Layouts { @Override public String getLauncherClassName() { - return "org.springframework.boot.loader.PropertiesLauncher"; + return "org.springframework.boot.loader.launch.PropertiesLauncher"; } } @@ -148,7 +148,7 @@ public final class Layouts { @Override public String getLauncherClassName() { - return "org.springframework.boot.loader.WarLauncher"; + return "org.springframework.boot.loader.launch.WarLauncher"; } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java index 3429e4af90..c4986aba56 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java @@ -105,7 +105,7 @@ abstract class AbstractPackagerTests

{ execute(packager, NO_LIBRARIES); Manifest actualManifest = getPackagedManifest(); assertThat(actualManifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.JarLauncher"); + .isEqualTo("org.springframework.boot.loader.launch.JarLauncher"); assertThat(actualManifest.getMainAttributes().getValue("Start-Class")).isEqualTo("a.b.C"); assertThat(hasPackagedLauncherClasses()).isTrue(); } @@ -121,7 +121,7 @@ abstract class AbstractPackagerTests

{ execute(packager, NO_LIBRARIES); Manifest actualManifest = getPackagedManifest(); assertThat(actualManifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.JarLauncher"); + .isEqualTo("org.springframework.boot.loader.launch.JarLauncher"); assertThat(actualManifest.getMainAttributes().getValue("Start-Class")).isEqualTo("a.b.C"); assertThat(hasPackagedLauncherClasses()).isTrue(); } @@ -133,7 +133,7 @@ abstract class AbstractPackagerTests

{ execute(packager, NO_LIBRARIES); Manifest actualManifest = getPackagedManifest(); assertThat(actualManifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.JarLauncher"); + .isEqualTo("org.springframework.boot.loader.launch.JarLauncher"); assertThat(actualManifest.getMainAttributes().getValue("Start-Class")).isEqualTo("a.b.C"); assertThat(hasPackagedLauncherClasses()).isTrue(); } @@ -684,7 +684,7 @@ abstract class AbstractPackagerTests

{ protected boolean hasPackagedLauncherClasses() throws IOException { return hasPackagedEntry("org/springframework/boot/") - && hasPackagedEntry("org/springframework/boot/loader/JarLauncher.class"); + && hasPackagedEntry("org/springframework/boot/loader/launch/JarLauncher.class"); } private boolean hasPackagedEntry(String name) throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java index a4a648c34f..f1dd7d583d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java @@ -79,7 +79,7 @@ class RepackagerTests extends AbstractPackagerTests { repackager.repackage(NO_LIBRARIES); Manifest actualManifest = getPackagedManifest(); assertThat(actualManifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.JarLauncher"); + .isEqualTo("org.springframework.boot.loader.launch.JarLauncher"); assertThat(actualManifest.getMainAttributes().getValue("Start-Class")).isEqualTo("a.b.C"); assertThat(hasPackagedLauncherClasses()).isTrue(); } @@ -220,7 +220,7 @@ class RepackagerTests extends AbstractPackagerTests { private boolean hasLauncherClasses(File file) throws IOException { return hasEntry(file, "org/springframework/boot/") - && hasEntry(file, "org/springframework/boot/loader/JarLauncher.class"); + && hasEntry(file, "org/springframework/boot/loader/launch/JarLauncher.class"); } private boolean hasEntry(File file, String name) throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/JarLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/JarLauncher.java new file mode 100644 index 0000000000..5beb8d1096 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/JarLauncher.java @@ -0,0 +1,34 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.loader.launch; + +/** + * Repackaged {@link org.springframework.boot.loader.JarLauncher}. + * + * @author Phillip Webb + * @since 3.2.0 + */ +public final class JarLauncher { + + private JarLauncher() { + } + + public static void main(String[] args) throws Exception { + org.springframework.boot.loader.JarLauncher.main(args); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/PropertiesLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/PropertiesLauncher.java new file mode 100644 index 0000000000..d80fb0bb71 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/PropertiesLauncher.java @@ -0,0 +1,34 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.loader.launch; + +/** + * Repackaged {@link org.springframework.boot.loader.PropertiesLauncher}. + * + * @author Phillip Webb + * @since 3.2.0 + */ +public final class PropertiesLauncher { + + private PropertiesLauncher() { + } + + public static void main(String[] args) throws Exception { + org.springframework.boot.loader.PropertiesLauncher.main(args); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/WarLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/WarLauncher.java new file mode 100644 index 0000000000..9392d3bf2b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/WarLauncher.java @@ -0,0 +1,34 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.loader.launch; + +/** + * Repackaged {@link org.springframework.boot.loader.WarLauncher}. + * + * @author Phillip Webb + * @since 3.2.0 + */ +public final class WarLauncher { + + private WarLauncher() { + } + + public static void main(String[] args) throws Exception { + org.springframework.boot.loader.WarLauncher.main(args); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/package-info.java new file mode 100644 index 0000000000..7968d509a2 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Repackaged launcher classes. + * + * @see org.springframework.boot.loader.launch.JarLauncher + * @see org.springframework.boot.loader.launch.WarLauncher + */ +package org.springframework.boot.loader.launch; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java index 07eeaaa70b..1d37949cfa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java @@ -57,7 +57,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { File repackaged = new File(project, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"); assertThat(launchScript(repackaged)).isEmpty(); assertThat(jar(repackaged)).manifest((manifest) -> { - manifest.hasMainClass("org.springframework.boot.loader.JarLauncher"); + manifest.hasMainClass("org.springframework.boot.loader.launch.JarLauncher"); manifest.hasStartClass("some.random.Main"); manifest.hasAttribute("Not-Used", "Foo"); }) @@ -66,7 +66,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-6") .hasEntryWithName("BOOT-INF/classes/org/test/SampleApplication.class") - .hasEntryWithName("org/springframework/boot/loader/JarLauncher.class"); + .hasEntryWithName("org/springframework/boot/loader/launch/JarLauncher.class"); assertThat(buildLog(project)) .contains("Replacing main artifact " + repackaged + " with repackaged archive,") .contains("The original artifact has been renamed to " + original) @@ -273,9 +273,9 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { .goals("package", "-Dspring-boot.repackage.layout=ZIP") .execute((project) -> { File main = new File(project, "target/jar-with-layout-property-0.0.1.BUILD-SNAPSHOT.jar"); - assertThat(jar(main)) - .manifest((manifest) -> manifest.hasMainClass("org.springframework.boot.loader.PropertiesLauncher") - .hasStartClass("org.test.SampleApplication")); + assertThat(jar(main)).manifest( + (manifest) -> manifest.hasMainClass("org.springframework.boot.loader.launch.PropertiesLauncher") + .hasStartClass("org.test.SampleApplication")); assertThat(buildLog(project)).contains("Layout: ZIP"); }); } @@ -284,9 +284,9 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { void whenALayoutIsConfiguredTheSpecifiedLayoutIsUsed(MavenBuild mavenBuild) { mavenBuild.project("jar-with-zip-layout").execute((project) -> { File main = new File(project, "target/jar-with-zip-layout-0.0.1.BUILD-SNAPSHOT.jar"); - assertThat(jar(main)) - .manifest((manifest) -> manifest.hasMainClass("org.springframework.boot.loader.PropertiesLauncher") - .hasStartClass("org.test.SampleApplication")); + assertThat(jar(main)).manifest( + (manifest) -> manifest.hasMainClass("org.springframework.boot.loader.launch.PropertiesLauncher") + .hasStartClass("org.test.SampleApplication")); assertThat(buildLog(project)).contains("Layout: ZIP"); }); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java index 0a8894cb6b..e7cebf3c57 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java @@ -57,10 +57,10 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests { .hasEntryWithNameStartingWith("WEB-INF/lib/spring-core") .hasEntryWithNameStartingWith("WEB-INF/lib/spring-jcl") .hasEntryWithNameStartingWith("WEB-INF/lib-provided/jakarta.servlet-api-6") - .hasEntryWithName("org/springframework/boot/loader/WarLauncher.class") + .hasEntryWithName("org/springframework/boot/loader/launch/WarLauncher.class") .hasEntryWithName("WEB-INF/classes/org/test/SampleApplication.class") .hasEntryWithName("index.html") - .manifest((manifest) -> manifest.hasMainClass("org.springframework.boot.loader.WarLauncher") + .manifest((manifest) -> manifest.hasMainClass("org.springframework.boot.loader.launch.WarLauncher") .hasStartClass("org.test.SampleApplication") .hasAttribute("Not-Used", "Foo"))); } diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java index ab376dd3ee..76e642d3f2 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java @@ -93,9 +93,10 @@ class PaketoBuilderTests { .contains("paketo-buildpacks/ca-certificates", "paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar", "paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot"); - metadata.processOfType("web").containsExactly("java", "org.springframework.boot.loader.JarLauncher"); + metadata.processOfType("web") + .containsExactly("java", "org.springframework.boot.loader.launch.launch.JarLauncher"); metadata.processOfType("executable-jar") - .containsExactly("java", "org.springframework.boot.loader.JarLauncher"); + .containsExactly("java", "org.springframework.boot.loader.launch.launch.JarLauncher"); }); assertImageHasJvmSbomLayer(imageReference, config); assertImageHasDependenciesSbomLayer(imageReference, config, "executable-jar"); @@ -238,9 +239,10 @@ class PaketoBuilderTests { .contains("paketo-buildpacks/ca-certificates", "paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar", "paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot"); - metadata.processOfType("web").containsExactly("java", "org.springframework.boot.loader.WarLauncher"); + metadata.processOfType("web") + .containsExactly("java", "org.springframework.boot.loader.launch.WarLauncher"); metadata.processOfType("executable-jar") - .containsExactly("java", "org.springframework.boot.loader.WarLauncher"); + .containsExactly("java", "org.springframework.boot.loader.launch.WarLauncher"); }); assertImageHasJvmSbomLayer(imageReference, config); assertImageHasDependenciesSbomLayer(imageReference, config, "executable-jar"); diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java index dc8fb37a0c..b066ac9be0 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,8 +55,8 @@ class ExplodedApplicationLauncher extends AbstractApplicationLauncher { @Override protected List getArguments(File archive, File serverPortFile) { - String mainClass = (archive.getName().endsWith(".war") ? "org.springframework.boot.loader.WarLauncher" - : "org.springframework.boot.loader.JarLauncher"); + String mainClass = (archive.getName().endsWith(".war") ? "org.springframework.boot.loader.launch.WarLauncher" + : "org.springframework.boot.loader.launch.JarLauncher"); try { explodeArchive(archive); return Arrays.asList("-cp", this.exploded.getAbsolutePath(), mainClass, serverPortFile.getAbsolutePath()); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml index 418a7501f0..091e4aa116 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml @@ -67,7 +67,7 @@ - +