Skip to content

Commit 186c6e1

Browse files
committed
Fix META-INF/versions relocation
1 parent 1e92087 commit 186c6e1

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

pom.xml

+30-28
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@
640640
<sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
641641
<sortExecutions>true</sortExecutions>
642642
<sortModules>true</sortModules>
643-
<sortPlugins>groupId,artifactId</sortPlugins>
644643
<sortProperties>true</sortProperties>
645644
<verifyFail>stop</verifyFail>
646645
<verifyFailOn>strict</verifyFailOn>
@@ -1066,33 +1065,6 @@
10661065
</activation>
10671066
<build>
10681067
<plugins>
1069-
<plugin>
1070-
<!-- relocate the META-INF/versions files manually due to the maven bug -->
1071-
<!-- https://issues.apache.org/jira/browse/MSHADE-406 -->
1072-
<groupId>org.apache.maven.plugins</groupId>
1073-
<artifactId>maven-antrun-plugin</artifactId>
1074-
<executions>
1075-
<execution>
1076-
<id>repack</id>
1077-
<goals>
1078-
<goal>run</goal>
1079-
</goals>
1080-
<phase>package</phase>
1081-
<configuration>
1082-
<target>
1083-
<unzip dest="${project.build.directory}/relocate" src="${project.build.directory}/${project.build.finalName}.jar"/>
1084-
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
1085-
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
1086-
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
1087-
<zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/>
1088-
<delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
1089-
<delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
1090-
<delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
1091-
</target>
1092-
</configuration>
1093-
</execution>
1094-
</executions>
1095-
</plugin>
10961068
<plugin>
10971069
<!-- google linkage checker doesn't work well with shaded jar, disable the check in this case for now -->
10981070
<groupId>org.apache.maven.plugins</groupId>
@@ -1344,6 +1316,36 @@
13441316
</execution>
13451317
</executions>
13461318
</plugin>
1319+
<plugin>
1320+
<!-- relocate the META-INF/versions files manually due to the maven bug -->
1321+
<!-- https://issues.apache.org/jira/browse/MSHADE-406 -->
1322+
<groupId>org.apache.maven.plugins</groupId>
1323+
<artifactId>maven-antrun-plugin</artifactId>
1324+
<executions>
1325+
<execution>
1326+
<id>repack</id>
1327+
<goals>
1328+
<goal>run</goal>
1329+
</goals>
1330+
<phase>package</phase>
1331+
<configuration>
1332+
<target>
1333+
<unzip dest="${project.build.directory}/relocate" src="${project.build.directory}/${project.build.finalName}.jar"/>
1334+
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
1335+
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
1336+
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
1337+
<move file="${project.build.directory}/relocate/META-INF/versions/9/org" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
1338+
<move file="${project.build.directory}/relocate/META-INF/versions/11/org" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
1339+
<move file="${project.build.directory}/relocate/META-INF/versions/15/org" todir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
1340+
<zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/>
1341+
<delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
1342+
<delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
1343+
<delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
1344+
</target>
1345+
</configuration>
1346+
</execution>
1347+
</executions>
1348+
</plugin>
13471349
<plugin>
13481350
<groupId>org.codehaus.mojo</groupId>
13491351
<artifactId>buildnumber-maven-plugin</artifactId>

0 commit comments

Comments
 (0)