-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Jar entries are duplicated in BOOT-INF/lib with layered jars and Maven #23801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm having trouble replicating this issue. Could you please share a sample project that shows the problem? |
Project where I encounter this issue: https://github.com/Ahli/Galaxy-Observer-UI/tree/master/tools/interfaceBuilder I will try and reduce this to a small standalone project demonstrating the issue. |
I'm manged to build that project after running Is there any trick to getting the duplicate entries? What operating system are you using? |
My environment: Win 10 20H2, JDK 15, Maven 3.5.3, IntelliJ IDEA 2020.3EAP Here are the jars generated for me (placed in a single zip): https://www.dropbox.com/s/vz1gj1brakt33pr/spring_issue23801.zip?dl=1 Using 7zip, the jars inside BOOT-INF\lib\ are listed as duplicates. Extracting the zip asks for these files to be overwritten. The expected jar size would be approx 56mb (as created with M1). The jar it generates is approx 112mb. |
I think I see the duplicates. They're in |
A standard project from start.spring.io with the following plugin config replicates it: <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>spring-boot</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build> |
The issue is not present when layering is disabled.
Layering was enabled by default between M1 and M2 (between 29th June and 14th August 2020). Commit History: https://github.com/spring-projects/spring-boot/commits/master/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven |
All of the launcher classes are also packaged twice. Once beneath |
The launcher classes and the contents of <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
<classifier>spring-boot</classifier>
</configuration>
</execution>
</executions>
</plugin> The duplication of the launcher classes seems to be unrelated to layers as it also occurs with layers disabled. |
In my project, a generated executable jar contains every jar within the BOOT-INF/lib directory twice with identical file names. This pretty much doubles the size of the final jar.
The issue is not present in 2.4.0-M1 of the Maven-Plugin.
The issue is present since 2.4.0-M2. So, M4 still contains it.
The produced executable jar is functional. Just the file size is doubled.
My library usage:
The text was updated successfully, but these errors were encountered: