Skip to content
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

Fix META-INF/versions relocation #1504

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 30 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@
<sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
<sortExecutions>true</sortExecutions>
<sortModules>true</sortModules>
<sortPlugins>groupId,artifactId</sortPlugins>
<sortProperties>true</sortProperties>
<verifyFail>stop</verifyFail>
<verifyFailOn>strict</verifyFailOn>
Expand Down Expand Up @@ -1066,33 +1065,6 @@
</activation>
<build>
<plugins>
<plugin>
<!-- relocate the META-INF/versions files manually due to the maven bug -->
<!-- https://issues.apache.org/jira/browse/MSHADE-406 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>repack</id>
<goals>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<target>
<unzip dest="${project.build.directory}/relocate" src="${project.build.directory}/${project.build.finalName}.jar"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
<zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- google linkage checker doesn't work well with shaded jar, disable the check in this case for now -->
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -1344,6 +1316,36 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- relocate the META-INF/versions files manually due to the maven bug -->
<!-- https://issues.apache.org/jira/browse/MSHADE-406 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>repack</id>
<goals>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<target>
<unzip dest="${project.build.directory}/relocate" src="${project.build.directory}/${project.build.finalName}.jar"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/9/org" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/11/org" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/15/org" todir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
<zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
Expand Down
Loading