问题
As far as I know, spring-boot-maven-plugin has already provided a way to distribute the entire application in a fat executable jar file: spring-boot-maven-plugin
However, sometimes we don't want a fat executable jar that encapsulates all the modules and dependencies and configuration files and such, maybe a zip/tar file with the main module in a jar and launch scripts for different platforms alongside the jar, and dependencies under the lib folder and configurations file reside in the conf folder:
application.zip mainApp.jar run.sh run.bat lib a.jar b.jar c.jar conf application.properties logback.xml
How to make a distribution in this structure?
回答1:
Use the Maven Appassembler plugin - their program
example seems to be close to what you're looking for. The output will look something like:
.
`-- target
`-- appassembler
|-- bin
| |-- basic-test
| `-- basic-test.bat
`-- repo
`-- org
`-- codehaus
`-- mojo
`-- appassembler-maven-plugin
`-- it
`-- platforms-test
|-- 1.0-SNAPSHOT
| |-- maven-metadata-appassembler.xml
| `-- platforms-test-1.0-SNAPSHOT.jar
`-- maven-metadata-appassembler.xml
来源:https://stackoverflow.com/questions/35061619/alternatives-to-distribute-spring-boot-application-using-maven-other-than-sprin