Предисловие
Springboot использует пакет JAR для разделения файлов LIB и конфигурации. Я не пробовал это. После обсуждения с Лю Дашеном (великий Бог не имеет блога, это жаль), я дал это решение для вашей ссылки.
Среда развертывания
Pom.xml
<? 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"> <dolidayversion> 4.0.0 </modelversion> <groupid> com.elvish </GroupD> </artifactid> test> </artifactid> <sersion> 0.0.1-snapshot </version> <duckaging> jar </packaging> <mame> test </name> <distice> test </description> <parent> <groupid> org.springframework.boot </GroupId> <ratifactid> spring-boot-starter-parent </artifactid> <sersere> 1.5.10.Release> </artivepate </artifactid> <seriate> 1.5.10.Release> </artifactid> <persion> 1.5.10.Release </artifactypath <project.build.sourceencoding> utf-8 </project.build.sourceencoding> <project.reporting.outputencoding> utf-8 </project.Report.OutputEncoding> <java.version> 1.8 </java.version> </properties> <зависимости> <зависимости>. <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId> org.apache.maven.plugins </GroupId> <artifactId> maven-vendence-plugin </artifactid> <ferainations> <ceffision> <id>-copy-nepectents </id> <phase> package </phase> <Голы> <cept> yportire-lebendents </ogle> </ogle> <fice> </phase> joopry> <conculUdeTransitive> false </exceleadEransitive> <stripVersion> false </stripVersion> <ClackOpe> выполнение </inclusteScope> </configuration> </выполнение> </refections> </placin> <blicin> <groupid> org.apache.maven.plugins </GroupId> <StrifActId> maven-jar-ppugInd <//GroupID> <StrifActId> <concellide> **/*. Свойства </exclude> <cextude> **/*. xml </exclide> <concellide> **/*. yml </exclude> <concellide> static/** </exclude> <concloadde> templates/** </exclude> </excudes> </configuration> </plugin> <blicin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <layout>ZIP</layout> <includes> <include> <groupId>non-exists</groupId> <artifactId>non-exists</artifactId> </includes> </configuration> <executions> <execution> <goals> <COLE> переупаковка </oal> </oal> <figureturation> <slassicifier> classes </classifier> <tact> false </attach> </configuration> </выполнение> </reavelions> </placin> <blicin> <groupid> org.apache.maven.plugins </GroupD> <ratifactid> maven-antrun-prugin </artifactid> </GroupD> <strifactid> maven-plugin. <phase> package </phase> <ogle> <oal> run </ogle> </oal> <configuration> <target> <name = "dist"> target/distribution </property> <name = "dist-tmp"> target/distribution/tmp </property> <property name = "app-amame"> {project.artifactid}-$ {project.version} </mk whip> <mkdr> <mkdir> <mkdir> <mkdir> <mkdir> <mkdir> <mkdir> <mkdir> <mkdir> <mkdir> <mkdir> </mk. dir = "$ {dist-tmp}" /> <copy file = "target /$ {app-name} .jar" tofile = "$ {dist-tmp} /$ {app-name} .jar" /> <unzip src = "$ {dist-tmp} /$ {app-name} .jar" dest = "$ {dist-tmp} /$ {app-name} .jar". file = "$ {dist-tmp}/$ {app-name} .jar"/> <Zip destfile = "$ {dist}/$ {app-name} -pages.jar"> <Zipfileset dir = "$ {dist-tmp}/meta-inf" prefix = "meta-inf"/> <zipfileset dir/"argetemtemp}/" meta-yarkex = stative "/staricex =" argetemtemet leartemet dir/"argetemtemet ler/" argex = "arge-vefix"/zipfileset dir/"argetemplesete ilmp}/meta-inf". /> <Zipfileset dir = "target/classes/templates" prefix = "templates"/> </Zip> <hove file = "target/$ {app-name} -classs.jar" todir = "$ {dist}"/> <ove todir = "$ {dist}/3rd-lib"> <fileSet let dir dir dir dir dir dir dir dir dir = dir = "$ {dist-tmp}"/> <copy todir = "$ {dist}"> <fileSet dir = "target/class"> <include name = "**/*. Properties"/> <include name = "**/*. XML"/> <include name = "**/*. yml"/> </*. </plugin> </plugins> </build> </project>После завершения пакета
Запустить банку
java -jar -dloader.path =., 3-й Lib test-0.0.1-snapshot-classes.jar
Суммировать
Выше приведено правильный метод конфигурации для отделения LIB от пакетов Spring Boot Jar, который редактор представил вам. Я надеюсь, что это будет полезно для вас. Если у вас есть какие -либо вопросы, пожалуйста, оставьте мне сообщение, и редактор ответит вам вовремя. Большое спасибо за вашу поддержку сайту wulin.com!