ОК, чтобы решить проблему, в моей сборке пакета maven;
1) Invoked ANT to unzip the released template SPRING-BOOT-app.jar
2) Unzip and repackage additional shaded artefact from the project
3) Copy repackaged artefact under BOOT-INF/lib
4) Repackage SPRING-BOOT-app.jar
Мой pom теперь имеет следующий дополнительный шаг:
pom.xml
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>repackage-app</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="repack-app">
<property name="workDirectory" value="${project.build.directory}/app-repack" />
<property name="sourceArtifact" value="${project.build.directory}/SPRING-BOOT-app.jar" />
<property name="appendWith" value="${project.build.directory}/${project.artifactId}-${project.version}.jar" />
<ant antfile="${packager.utilities.directory}/build.xml">
<target name="append-and-repack-spring-boot-artiafact" />
</ant>
</target>
</configuration>
</execution>
</executions>
</plugin>
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="utilities" basedir=".">
<!-- Repack and append artifact to Spring Boot App -->
<target name="append-and-repack-spring-boot-artiafact">
<!-- Clean -->
<delete dir="${workDirectory}" failonerror="false"/>
<mkdir dir="${workDirectory}" />
<!-- Copy the original files -->
<copy file="${sourceArtifact}" todir="${workDirectory}"/>
<copy file="${appendWith}" todir="${workDirectory}" />
<!-- Get basename -->
<basename property="sourceArtifactName" file="${sourceArtifact}" />
<basename property="appendArtifactName" file="${appendWith}" />
<!-- repackage and append -->
<repack-jar artifact="${appendArtifactName}" reworkOutputDir="${workDirectory}/repackaged" />
<append artifact="${sourceArtifactName}" appendFrom="${workDirectory}/repackaged" location="BOOT-INF/lib" />
</target>
<!-- Repackage a single jar -->
<macrodef name="repack-jar">
<attribute name="artifact" />
<attribute name="reworkOutputDir" />
<sequential>
<echo
message="-------------- Repackaging @{artifact} --------------" />
<!-- Unpack and delete jar -->
<unzip dest="${workDirectory}/tmp" src="${workDirectory}/@{artifact}" />
<delete file="${workDirectory}/@{artifact}" />
<!-- Package jar -->
<jar manifest="${workDirectory}/tmp/META-INF/MANIFEST.MF"
compress="false" basedir="${workDirectory}/tmp"
destfile="@{reworkOutputDir}/@{artifact}" />
<delete dir="${workDirectory}/tmp" />
</sequential>
</macrodef>
<!-- Append artifact to jar -->
<macrodef name="append">
<attribute name="artifact" />
<attribute name="appendFrom" />
<attribute name="location" />
<sequential>
<echo
message="-------------- Unpacking @{artifact} --------------" />
<!-- Unpack and delete jar -->
<unzip dest="${workDirectory}/tmp" src="${workDirectory}/@{artifact}" />
<delete file="${workDirectory}/@{artifact}" />
<copy todir="${workDirectory}/tmp/@{location}" overwrite="true" force="true">
<fileset dir="@{appendFrom}" includes="*.jar" />
</copy>
<!-- Package jar -->
<jar manifest="${workDirectory}/tmp/META-INF/MANIFEST.MF"
compress="false" basedir="${workDirectory}/tmp"
destfile="${workDirectory}/@{artifact}" />
<delete dir="${workDirectory}/tmp" />
</sequential>
</macrodef>
</project>
ПРИМЕЧАНИЕ. НЕ ИСПОЛЬЗУЙТЕ 7Zip / Winrar или любые другие инструменты сжатия, чтобы открыть приложение Spring Boot, которым вы являетесьпланируем развернуть.Это обновит смещение сжатия (или что-то в этом роде), и приложение выйдет из строя.Только не трогайте артефакт, возьмите копию и осмотрите!