Update classpath index to use jar name instead of full path
See gh-20564
This commit is contained in:
@@ -164,10 +164,8 @@ class BootJarTests extends AbstractBootArchiveTests<BootJar> {
|
||||
@Test
|
||||
void whenJarIsLayeredClasspathIndexPointsToLayeredLibs() throws IOException {
|
||||
try (JarFile jarFile = new JarFile(createLayeredJar())) {
|
||||
assertThat(entryLines(jarFile, "BOOT-INF/classpath.idx")).containsExactly(
|
||||
"BOOT-INF/layers/dependencies/lib/first-library.jar",
|
||||
"BOOT-INF/layers/dependencies/lib/second-library.jar",
|
||||
"BOOT-INF/layers/snapshot-dependencies/lib/third-library-SNAPSHOT.jar");
|
||||
assertThat(entryLines(jarFile, "BOOT-INF/classpath.idx")).containsExactly("first-library.jar",
|
||||
"second-library.jar", "third-library-SNAPSHOT.jar");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,8 +187,8 @@ class BootJarTests extends AbstractBootArchiveTests<BootJar> {
|
||||
try (JarFile jarFile = new JarFile(createPopulatedJar())) {
|
||||
assertThat(jarFile.getManifest().getMainAttributes().getValue("Spring-Boot-Classpath-Index"))
|
||||
.isEqualTo("BOOT-INF/classpath.idx");
|
||||
assertThat(entryLines(jarFile, "BOOT-INF/classpath.idx")).containsExactly("BOOT-INF/lib/first-library.jar",
|
||||
"BOOT-INF/lib/second-library.jar", "BOOT-INF/lib/third-library-SNAPSHOT.jar");
|
||||
assertThat(entryLines(jarFile, "BOOT-INF/classpath.idx")).containsExactly("first-library.jar",
|
||||
"second-library.jar", "third-library-SNAPSHOT.jar");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user