forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add group discriminant in case of conflict
Prior to this commit, the repackage goal silently ignored the case of two libraries having the same name and version but a different group. As a result, the second library was overwriting the first one in the repackaged jar. This commit adds support for custom Library names and updates the Maven and Gradle plugins so that the name includes the group ID when there would otherwise be a duplicate. Fixes spring-projectsgh-1475
- Loading branch information
Showing
69 changed files
with
299 additions
and
25 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
spring-boot-samples/spring-boot-sample-simple/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: Phil |
Binary file added
BIN
+1.14 KB
...ring-boot-sample-simple/org/springframework/boot/loader/ExecutableArchiveLauncher$1.class
Binary file not shown.
Binary file added
BIN
+4.54 KB
...spring-boot-sample-simple/org/springframework/boot/loader/ExecutableArchiveLauncher.class
Binary file not shown.
Binary file added
BIN
+1.06 KB
...oot-sample-simple/org/springframework/boot/loader/InputArgumentsJavaAgentDetector$1.class
Binary file not shown.
Binary file added
BIN
+3.29 KB
...-boot-sample-simple/org/springframework/boot/loader/InputArgumentsJavaAgentDetector.class
Binary file not shown.
Binary file added
BIN
+1.87 KB
...-boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/JarLauncher.class
Binary file not shown.
Binary file added
BIN
+192 Bytes
...samples/spring-boot-sample-simple/org/springframework/boot/loader/JavaAgentDetector.class
Binary file not shown.
Binary file added
BIN
+1.36 KB
.../spring-boot-sample-simple/org/springframework/boot/loader/LaunchedURLClassLoader$1.class
Binary file not shown.
Binary file added
BIN
+2.11 KB
.../spring-boot-sample-simple/org/springframework/boot/loader/LaunchedURLClassLoader$2.class
Binary file not shown.
Binary file added
BIN
+5.31 KB
...es/spring-boot-sample-simple/org/springframework/boot/loader/LaunchedURLClassLoader.class
Binary file not shown.
Binary file added
BIN
+5.6 KB
spring-boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/Launcher.class
Binary file not shown.
Binary file added
BIN
+1.91 KB
...-samples/spring-boot-sample-simple/org/springframework/boot/loader/MainMethodRunner.class
Binary file not shown.
Binary file added
BIN
+266 Bytes
...ples/spring-boot-sample-simple/org/springframework/boot/loader/PropertiesLauncher$1.class
Binary file not shown.
Binary file added
BIN
+1.64 KB
...sample-simple/org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class
Binary file not shown.
Binary file added
BIN
+1.92 KB
...mple/org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class
Binary file not shown.
Binary file added
BIN
+17.2 KB
...amples/spring-boot-sample-simple/org/springframework/boot/loader/PropertiesLauncher.class
Binary file not shown.
Binary file added
BIN
+1.51 KB
...oot-samples/spring-boot-sample-simple/org/springframework/boot/loader/WarLauncher$1.class
Binary file not shown.
Binary file added
BIN
+2.89 KB
...-boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/WarLauncher.class
Binary file not shown.
Binary file added
BIN
+333 Bytes
...les/spring-boot-sample-simple/org/springframework/boot/loader/archive/Archive$Entry.class
Binary file not shown.
Binary file added
BIN
+399 Bytes
...ring-boot-sample-simple/org/springframework/boot/loader/archive/Archive$EntryFilter.class
Binary file not shown.
Binary file added
BIN
+506 Bytes
...oot-sample-simple/org/springframework/boot/loader/archive/Archive$EntryRenameFilter.class
Binary file not shown.
Binary file added
BIN
+2.36 KB
...t-samples/spring-boot-sample-simple/org/springframework/boot/loader/archive/Archive.class
Binary file not shown.
Binary file added
BIN
+1.28 KB
...oot-sample-simple/org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class
Binary file not shown.
Binary file added
BIN
+884 Bytes
...e/org/springframework/boot/loader/archive/ExplodedArchive$FileNotFoundURLConnection.class
Binary file not shown.
Binary file added
BIN
+1.82 KB
...le/org/springframework/boot/loader/archive/ExplodedArchive$FilteredURLStreamHandler.class
Binary file not shown.
Binary file added
BIN
+8.22 KB
...s/spring-boot-sample-simple/org/springframework/boot/loader/archive/ExplodedArchive.class
Binary file not shown.
Binary file added
BIN
+1.51 KB
...spring-boot-sample-simple/org/springframework/boot/loader/archive/FilteredArchive$1.class
Binary file not shown.
Binary file added
BIN
+1.95 KB
...spring-boot-sample-simple/org/springframework/boot/loader/archive/FilteredArchive$2.class
Binary file not shown.
Binary file added
BIN
+3.65 KB
...s/spring-boot-sample-simple/org/springframework/boot/loader/archive/FilteredArchive.class
Binary file not shown.
Binary file added
BIN
+1.9 KB
.../spring-boot-sample-simple/org/springframework/boot/loader/archive/JarFileArchive$1.class
Binary file not shown.
Binary file added
BIN
+1.16 KB
...t-sample-simple/org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class
Binary file not shown.
Binary file added
BIN
+7.9 KB
...es/spring-boot-sample-simple/org/springframework/boot/loader/archive/JarFileArchive.class
Binary file not shown.
Binary file added
BIN
+1.5 KB
...g-boot-sample-simple/org/springframework/boot/loader/data/ByteArrayRandomAccessData.class
Binary file not shown.
Binary file added
BIN
+1.31 KB
...-sample-simple/org/springframework/boot/loader/data/RandomAccessData$ResourceAccess.class
Binary file not shown.
Binary file added
BIN
+551 Bytes
...les/spring-boot-sample-simple/org/springframework/boot/loader/data/RandomAccessData.class
Binary file not shown.
Binary file added
BIN
+3.44 KB
...le-simple/org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class
Binary file not shown.
Binary file added
BIN
+2.18 KB
...ot-sample-simple/org/springframework/boot/loader/data/RandomAccessDataFile$FilePool.class
Binary file not shown.
Binary file added
BIN
+3.31 KB
...spring-boot-sample-simple/org/springframework/boot/loader/data/RandomAccessDataFile.class
Binary file not shown.
Binary file added
BIN
+2.11 KB
...ng-boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/Bytes.class
Binary file not shown.
Binary file added
BIN
+2.87 KB
...ng-boot-sample-simple/org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class
Binary file not shown.
Binary file added
BIN
+6.24 KB
...-boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/Handler.class
Binary file not shown.
Binary file added
BIN
+2.31 KB
...boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarEntry.class
Binary file not shown.
Binary file added
BIN
+5.71 KB
...-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarEntryData.class
Binary file not shown.
Binary file added
BIN
+314 Bytes
...amples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarEntryFilter.class
Binary file not shown.
Binary file added
BIN
+1.27 KB
...oot-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarFile$1.class
Binary file not shown.
Binary file added
BIN
+1.53 KB
...oot-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarFile$2.class
Binary file not shown.
Binary file added
BIN
+15.8 KB
...-boot-samples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarFile.class
Binary file not shown.
Binary file added
BIN
+672 Bytes
...es/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarURLConnection$1.class
Binary file not shown.
Binary file added
BIN
+2.76 KB
...oot-sample-simple/org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class
Binary file not shown.
Binary file added
BIN
+6.41 KB
...ples/spring-boot-sample-simple/org/springframework/boot/loader/jar/JarURLConnection.class
Binary file not shown.
Binary file added
BIN
+1.59 KB
...pring-boot-sample-simple/org/springframework/boot/loader/jar/ZipInflaterInputStream.class
Binary file not shown.
Binary file added
BIN
+3.61 KB
...t-samples/spring-boot-sample-simple/org/springframework/boot/loader/util/AsciiBytes.class
Binary file not shown.
Binary file added
BIN
+4.84 KB
.../spring-boot-sample-simple/org/springframework/boot/loader/util/SystemPropertyUtils.class
Binary file not shown.
Binary file added
BIN
+1.38 KB
spring-boot-samples/spring-boot-sample-simple/sample/simple/SampleSimpleApplication.class
Binary file not shown.
Binary file added
BIN
+801 Bytes
spring-boot-samples/spring-boot-sample-simple/sample/simple/service/HelloWorldService.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?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> | ||
<artifactId>acme-lib</artifactId> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot.maven.it</groupId> | ||
<artifactId>jar-lib-name-conflict</artifactId> | ||
<version>0.0.1.BUILD-SNAPSHOT</version> | ||
</parent> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>4.0.5.RELEASE</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
14 changes: 14 additions & 0 deletions
14
...boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/another-acme-lib/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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.another</groupId> | ||
<artifactId>acme-lib</artifactId> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot.maven.it</groupId> | ||
<artifactId>jar-lib-name-conflict</artifactId> | ||
<version>0.0.1.BUILD-SNAPSHOT</version> | ||
</parent> | ||
|
||
</project> |
19 changes: 19 additions & 0 deletions
19
spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?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-lib-name-conflict</artifactId> | ||
<version>0.0.1.BUILD-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<modules> | ||
<module>acme-lib</module> | ||
<module>another-acme-lib</module> | ||
<module>test-project</module> | ||
</modules> | ||
|
||
</project> |
58 changes: 58 additions & 0 deletions
58
spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?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>test-project</artifactId> | ||
<version>0.0.1.BUILD-SNAPSHOT</version> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.4</version> | ||
<configuration> | ||
<archive> | ||
<manifestEntries> | ||
<Not-Used>Foo</Not-Used> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<!-- Two dependencies with the same artifactId --> | ||
<dependency> | ||
<groupId>org.springframework.boot.maven.it</groupId> | ||
<artifactId>acme-lib</artifactId> | ||
<version>0.0.1.BUILD-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot.maven.it.another</groupId> | ||
<artifactId>acme-lib</artifactId> | ||
<version>0.0.1.BUILD-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<version>3.0.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
8 changes: 8 additions & 0 deletions
8
...n/src/it/jar-lib-name-conflict/test-project/src/main/java/org/test/SampleApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.test; | ||
|
||
public class SampleApplication { | ||
|
||
public static void main(String[] args) { | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import java.io.*; | ||
import org.springframework.boot.maven.*; | ||
|
||
File f = new File(basedir, "test-project/target/test-project-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("lib/org.springframework.boot.maven.it-acme-lib-0.0.1.BUILD-SNAPSHOT.jar") | ||
verifier.assertHasEntryNameStartingWith("lib/org.springframework.boot.maven.it.another-acme-lib-0.0.1.BUILD-SNAPSHOT.jar") | ||
} | ||
}.verify(); | ||
|
||
|
Oops, something went wrong.