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
cb6362df
Commit
cb6362df
authored
Feb 20, 2019
by
Robert Thornton
Committed by
Andy Wilkinson
Feb 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use kotlin_module not kotlin-module to identify Kotlin module metadata
See gh-16004
parent
91a005f5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
163 additions
and
5 deletions
+163
-5
Repackager.java
...ava/org/springframework/boot/loader/tools/Repackager.java
+1
-1
RepackagerTests.java
...rg/springframework/boot/loader/tools/RepackagerTests.java
+4
-4
pom.xml
...g-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml
+106
-0
SampleApplication.kt
...tlin-module/src/main/kotlin/org/test/SampleApplication.kt
+22
-0
verify.groovy
...-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy
+30
-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 @
cb6362df
...
@@ -381,7 +381,7 @@ public class Repackager {
...
@@ -381,7 +381,7 @@ public class Repackager {
}
}
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
().
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 @
cb6362df
...
@@ -679,15 +679,15 @@ public class RepackagerTests {
...
@@ -679,15 +679,15 @@ public class RepackagerTests {
public
void
kotlinModuleMetadataMovesBeneathBootInfClassesWhenRepackaged
()
public
void
kotlinModuleMetadataMovesBeneathBootInfClassesWhenRepackaged
()
throws
Exception
{
throws
Exception
{
this
.
testJarFile
.
addClass
(
"A.class"
,
ClassWithMainMethod
.
class
);
this
.
testJarFile
.
addClass
(
"A.class"
,
ClassWithMainMethod
.
class
);
this
.
testJarFile
.
addFile
(
"META-INF/test.kotlin
-
module"
,
this
.
testJarFile
.
addFile
(
"META-INF/test.kotlin
_
module"
,
this
.
temporaryFolder
.
newFile
(
"test.kotlin
-
module"
));
this
.
temporaryFolder
.
newFile
(
"test.kotlin
_
module"
));
File
source
=
this
.
testJarFile
.
getFile
();
File
source
=
this
.
testJarFile
.
getFile
();
File
dest
=
this
.
temporaryFolder
.
newFile
(
"dest.jar"
);
File
dest
=
this
.
temporaryFolder
.
newFile
(
"dest.jar"
);
Repackager
repackager
=
new
Repackager
(
source
);
Repackager
repackager
=
new
Repackager
(
source
);
repackager
.
repackage
(
dest
,
NO_LIBRARIES
);
repackager
.
repackage
(
dest
,
NO_LIBRARIES
);
try
(
JarFile
jarFile
=
new
JarFile
(
dest
))
{
try
(
JarFile
jarFile
=
new
JarFile
(
dest
))
{
assertThat
(
jarFile
.
getEntry
(
"META-INF/test.kotlin
-
module"
)).
isNull
();
assertThat
(
jarFile
.
getEntry
(
"META-INF/test.kotlin
_
module"
)).
isNull
();
assertThat
(
jarFile
.
getEntry
(
"BOOT-INF/classes/META-INF/test.kotlin
-
module"
))
assertThat
(
jarFile
.
getEntry
(
"BOOT-INF/classes/META-INF/test.kotlin
_
module"
))
.
isNotNull
();
.
isNotNull
();
}
}
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml
0 → 100644
View file @
cb6362df
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
jar-with-kotlin-module
</artifactId>
<version>
0.0.1.BUILD-SNAPSHOT
</version>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
@java.version@
</maven.compiler.source>
<maven.compiler.target>
@java.version@
</maven.compiler.target>
</properties>
<build>
<sourceDirectory>
${project.basedir}/src/main/kotlin
</sourceDirectory>
<testSourceDirectory>
${project.basedir}/src/test/kotlin
</testSourceDirectory>
<plugins>
<plugin>
<groupId>
@project.groupId@
</groupId>
<artifactId>
@project.artifactId@
</artifactId>
<version>
@project.version@
</version>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
<configuration>
<requiresUnpack>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-compiler
</artifactId>
</dependency>
</requiresUnpack>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
<version>
@maven-jar-plugin.version@
</version>
<configuration>
<archive>
<manifestEntries>
<Not-Used>
Foo
</Not-Used>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-maven-plugin
</artifactId>
<version>
@kotlin.version@
</version>
<executions>
<execution>
<id>
compile
</id>
<phase>
process-resources
</phase>
<goals>
<goal>
compile
</goal>
</goals>
</execution>
<execution>
<id>
test-compile
</id>
<phase>
process-test-resources
</phase>
<goals>
<goal>
compile
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
<version>
@spring.version@
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
<version>
@servlet-api.version@
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
<version>
@log4j2.version@
</version>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-stdlib-jdk8
</artifactId>
<version>
@kotlin.version@
</version>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-reflect
</artifactId>
<version>
@kotlin.version@
</version>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-compiler
</artifactId>
<version>
@kotlin.version@
</version>
</dependency>
</dependencies>
</project>
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/src/main/kotlin/org/test/SampleApplication.kt
0 → 100644
View file @
cb6362df
/*
* Copyright 2012-2017 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
*
* http://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.
*/
@file
:
JvmName
(
"SampleApplication"
)
package
org.test;
fun
main
(
args
:
Array
<
String
>)
{
}
\ No newline at end of file
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy
0 → 100644
View file @
cb6362df
/*
* Copyright 2012-2016 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
*
* http://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.
*/
import
java.io.*
;
import
org.springframework.boot.maven.*
;
File
f
=
new
File
(
basedir
,
"target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar"
);
new
Verify
.
JarArchiveVerification
(
f
,
Verify
.
SAMPLE_APP
)
{
@Override
protected
void
verifyZipEntries
(
Verify
.
ArchiveVerifier
verifier
)
throws
Exception
{
super
.
verifyZipEntries
(
verifier
)
verifier
.
assertHasEntryNameStartingWith
(
"BOOT-INF/classes/META-INF/jar-with-kotlin-module.kotlin_module"
)
verifier
.
assertHasUnpackEntry
(
"BOOT-INF/lib/kotlin-compiler-"
)
verifier
.
assertHasNonUnpackEntry
(
"BOOT-INF/lib/kotlin-stdlib-"
)
verifier
.
assertHasNonUnpackEntry
(
"BOOT-INF/lib/kotlin-reflect-"
)
}
}.
verify
();
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