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
cf01f9fb
Commit
cf01f9fb
authored
Jan 16, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for configuring layered jar layout
Closes gh-19768
parent
aed51abb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
0 deletions
+120
-0
JarIntegrationTests.java
...a/org/springframework/boot/maven/JarIntegrationTests.java
+11
-0
pom.xml
...ugin/src/intTest/projects/jar-layered/jar-release/pom.xml
+11
-0
pom.xml
...gin/src/intTest/projects/jar-layered/jar-snapshot/pom.xml
+11
-0
pom.xml
...maven-plugin/src/intTest/projects/jar-layered/jar/pom.xml
+44
-0
SampleApplication.java
...layered/jar/src/main/java/org/test/SampleApplication.java
+24
-0
pom.xml
...oot-maven-plugin/src/intTest/projects/jar-layered/pom.xml
+19
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java
View file @
cf01f9fb
...
@@ -26,6 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -26,6 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Integration tests for the Maven plugin's jar support.
* Integration tests for the Maven plugin's jar support.
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Madhura Bhave
*/
*/
@ExtendWith
(
MavenBuildExtension
.
class
)
@ExtendWith
(
MavenBuildExtension
.
class
)
class
JarIntegrationTests
extends
AbstractArchiveIntegrationTests
{
class
JarIntegrationTests
extends
AbstractArchiveIntegrationTests
{
...
@@ -280,4 +281,14 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
...
@@ -280,4 +281,14 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
});
});
}
}
@TestTemplate
void
whenJarIsRepackagedWithTheLayeredLayoutTheJarContainsLayers
(
MavenBuild
mavenBuild
)
{
mavenBuild
.
project
(
"jar-layered"
).
execute
((
project
)
->
{
File
repackaged
=
new
File
(
project
,
"jar/target/jar-layered-0.0.1.BUILD-SNAPSHOT.jar"
);
assertThat
(
jar
(
repackaged
)).
hasEntryWithNameStartingWith
(
"BOOT-INF/layers/application/classes/"
)
.
hasEntryWithNameStartingWith
(
"BOOT-INF/layers/dependencies/lib/jar-release"
)
.
hasEntryWithNameStartingWith
(
"BOOT-INF/layers/snapshot-dependencies/lib/jar-snapshot"
);
});
}
}
}
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-layered/jar-release/pom.xml
0 → 100644
View file @
cf01f9fb
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
jar-release
</artifactId>
<version>
0.0.1.RELEASE
</version>
<packaging>
jar
</packaging>
<name>
jar
</name>
<description>
Release Jar dependency
</description>
</project>
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-layered/jar-snapshot/pom.xml
0 → 100644
View file @
cf01f9fb
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
jar-snapshot
</artifactId>
<version>
0.0.1.BUILD-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
jar
</name>
<description>
Snapshot Jar dependency
</description>
</project>
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-layered/jar/pom.xml
0 → 100644
View file @
cf01f9fb
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
jar-layered
</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>
<plugins>
<plugin>
<groupId>
@project.groupId@
</groupId>
<artifactId>
@project.artifactId@
</artifactId>
<version>
@project.version@
</version>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
<configuration>
<layout>
LAYERED_JAR
</layout>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
jar-snapshot
</artifactId>
<version>
0.0.1.BUILD-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
jar-release
</artifactId>
<version>
0.0.1.RELEASE
</version>
</dependency>
</dependencies>
</project>
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-layered/jar/src/main/java/org/test/SampleApplication.java
0 → 100644
View file @
cf01f9fb
/*
* Copyright 2012-2020 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
*
* https://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.
*/
package
org
.
test
;
public
class
SampleApplication
{
public
static
void
main
(
String
[]
args
)
{
}
}
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-layered/pom.xml
0 → 100644
View file @
cf01f9fb
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.springframework.boot.maven.it
</groupId>
<artifactId>
aggregator
</artifactId>
<version>
0.0.1.BUILD-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<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>
<modules>
<module>
jar-snapshot
</module>
<module>
jar-release
</module>
<module>
jar
</module>
</modules>
</project>
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