Merge branch '2.5.x' into 2.6.x
Closes gh-28904
This commit is contained in:
@@ -213,6 +213,11 @@ abstract class AbstractArchiveIntegrationTests {
|
||||
return this;
|
||||
}
|
||||
|
||||
ManifestAssert doesNotHaveAttribute(String name) {
|
||||
assertThat(this.actual.getMainAttributes().getValue(name)).isNull();
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -365,6 +365,16 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void repackagedJarContainsClasspathIndex(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("jar").execute((project) -> {
|
||||
File repackaged = new File(project, "target/jar-0.0.1.BUILD-SNAPSHOT.jar");
|
||||
assertThat(jar(repackaged)).manifest(
|
||||
(manifest) -> manifest.hasAttribute("Spring-Boot-Classpath-Index", "BOOT-INF/classpath.idx"));
|
||||
assertThat(jar(repackaged)).hasEntryWithName("BOOT-INF/classpath.idx");
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void whenJarIsRepackagedWithOutputTimestampConfiguredThenJarIsReproducible(MavenBuild mavenBuild)
|
||||
throws InterruptedException {
|
||||
|
||||
@@ -210,6 +210,16 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void repackagedWarDoesNotContainClasspathIndex(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("war").execute((project) -> {
|
||||
File repackaged = new File(project, "target/war-0.0.1.BUILD-SNAPSHOT.war");
|
||||
assertThat(jar(repackaged))
|
||||
.manifest((manifest) -> manifest.doesNotHaveAttribute("Spring-Boot-Classpath-Index"));
|
||||
assertThat(jar(repackaged)).doesNotHaveEntryWithName("BOOT-INF/classpath.idx");
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void whenEntryIsExcludedItShouldNotBePresentInTheRepackagedWar(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("war-exclude-entry").execute((project) -> {
|
||||
|
||||
Reference in New Issue
Block a user