Browse Source

Remove some remnants of the embedded launch script support

See gh-47666
pull/47721/head
Andy Wilkinson 2 months ago
parent
commit
2b36c89e91
  1. 15
      build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java
  2. 29
      build-plugin/spring-boot-gradle-plugin/src/dockerTest/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithLaunchScript.gradle
  3. 5
      build-plugin/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java
  4. 1
      build-plugin/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java
  5. 1
      config/checkstyle/checkstyle-suppressions.xml

15
build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java

@ -306,21 +306,6 @@ class BootBuildImageIntegrationTests { @@ -306,21 +306,6 @@ class BootBuildImageIntegrationTests {
removeImages(projectName, "example.com/myapp:latest");
}
@TestTemplate
void buildsImageWithLaunchScript() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage");
String projectName = this.gradleBuild.getProjectDir().getName();
BuildTask task = result.task(":bootBuildImage");
assertThat(task).isNotNull();
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("---> Test Info buildpack building");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages(projectName);
}
@TestTemplate
void buildsImageWithNetworkModeNone() throws IOException {
writeMainClass();

29
build-plugin/spring-boot-gradle-plugin/src/dockerTest/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithLaunchScript.gradle

@ -1,29 +0,0 @@ @@ -1,29 +0,0 @@
/*
* Copyright 2012-present 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.
*/
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
bootJar {
launchScript()
}
bootBuildImage {
builder = "ghcr.io/spring-io/spring-boot-cnb-test-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
}

5
build-plugin/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java

@ -53,11 +53,6 @@ abstract class AbstractArchiveIntegrationTests { @@ -53,11 +53,6 @@ abstract class AbstractArchiveIntegrationTests {
return contentOf(new File(project, "target/build.log"));
}
protected String launchScript(File jar) {
String content = contentOf(jar);
return content.substring(0, content.indexOf(new String(new byte[] { 0x50, 0x4b, 0x03, 0x04 })));
}
protected AssertProvider<JarAssert> jar(File file) {
return new AssertProvider<>() {

1
build-plugin/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java

@ -57,7 +57,6 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { @@ -57,7 +57,6 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
File original = new File(project, "target/jar-0.0.1.BUILD-SNAPSHOT.jar.original");
assertThat(original).isFile();
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.launch.JarLauncher");
manifest.hasStartClass("some.random.Main");

1
config/checkstyle/checkstyle-suppressions.xml

@ -60,7 +60,6 @@ @@ -60,7 +60,6 @@
<suppress files="ValidatorPropertiesWithDefaultValues\.java" checks="SpringMethodVisibility" />
<suppress files="DevToolsTestApplication\.java" checks="SpringMethodVisibility" />
<suppress files="DevToolsR2dbcAutoConfigurationTests" checks="HideUtilityClassConstructor" />
<suppress files="AbstractLaunchScriptIntegrationTests" checks="IllegalImport" />
<suppress files="FailureAnalyzers\.java" checks="RedundantModifier" />
<suppress files="SpringBootVersion" checks="JavadocPackage" />
<suppress files="SpringBootProviderVersion" checks="JavadocPackage" />

Loading…
Cancel
Save