Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
948bafa4
Commit
948bafa4
authored
Feb 12, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repackage kotlin-module metadata beneath BOOT-INF/classes
Closes gh-15890
parent
3a6d15ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
Repackager.java
...ava/org/springframework/boot/loader/tools/Repackager.java
+2
-1
RepackagerTests.java
...rg/springframework/boot/loader/tools/RepackagerTests.java
+17
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java
View file @
948bafa4
...
@@ -380,7 +380,8 @@ public class Repackager {
...
@@ -380,7 +380,8 @@ public class Repackager {
return
null
;
return
null
;
}
}
if
((
entry
.
getName
().
startsWith
(
"META-INF/"
)
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
().
startsWith
(
"BOOT-INF/"
)
||
entry
.
getName
().
equals
(
"module-info.class"
))
{
||
entry
.
getName
().
equals
(
"module-info.class"
))
{
return
entry
;
return
entry
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java
View file @
948bafa4
...
@@ -675,6 +675,23 @@ public class RepackagerTests {
...
@@ -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
{
private
File
createLibrary
()
throws
IOException
{
TestJarFile
library
=
new
TestJarFile
(
this
.
temporaryFolder
);
TestJarFile
library
=
new
TestJarFile
(
this
.
temporaryFolder
);
library
.
addClass
(
"com/example/library/Library.class"
,
library
.
addClass
(
"com/example/library/Library.class"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment