Merge branch '2.1.x'
This commit is contained in:
commit
0adea5a905
|
@ -380,7 +380,8 @@ public class Repackager {
|
|||
return null;
|
||||
}
|
||||
if ((entry.getName().startsWith("META-INF/")
|
||||
&& !entry.getName().equals("META-INF/aop.xml"))
|
||||
&& !entry.getName().equals("META-INF/aop.xml")
|
||||
&& !entry.getName().endsWith(".kotlin-module"))
|
||||
|| entry.getName().startsWith("BOOT-INF/")
|
||||
|| entry.getName().equals("module-info.class")) {
|
||||
return entry;
|
||||
|
|
|
@ -675,6 +675,23 @@ public class RepackagerTests {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void kotlinModuleMetadataMovesBeneathBootInfClassesWhenRepackaged()
|
||||
throws Exception {
|
||||
this.testJarFile.addClass("A.class", ClassWithMainMethod.class);
|
||||
this.testJarFile.addFile("META-INF/test.kotlin-module",
|
||||
this.temporaryFolder.newFile("test.kotlin-module"));
|
||||
File source = this.testJarFile.getFile();
|
||||
File dest = this.temporaryFolder.newFile("dest.jar");
|
||||
Repackager repackager = new Repackager(source);
|
||||
repackager.repackage(dest, NO_LIBRARIES);
|
||||
try (JarFile jarFile = new JarFile(dest)) {
|
||||
assertThat(jarFile.getEntry("META-INF/test.kotlin-module")).isNull();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/classes/META-INF/test.kotlin-module"))
|
||||
.isNotNull();
|
||||
}
|
||||
}
|
||||
|
||||
private File createLibrary() throws IOException {
|
||||
TestJarFile library = new TestJarFile(this.temporaryFolder);
|
||||
library.addClass("com/example/library/Library.class",
|
||||
|
|
Loading…
Reference in New Issue