3

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?

Community
  • 1
  • 1
carusyte
  • 1,549
  • 17
  • 21

1 Answers1

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
Thorn G
  • 12,620
  • 2
  • 44
  • 56
  • This plugin is really simple and neat! It almost got me there. Since I am using multiple modules in my entire project, the Appassembler plugin seems unable to pick up the jar files of the dependent module in the same workspace. I've posted a new question as I think this relates to the Appassembler plugin now, and provided more detail about the configuration I used. Follow up if you are interested: [link](http://stackoverflow.com/questions/35076348/how-to-include-workspace-artifacts-in-the-assembly-using-appassembler-maven-plug) – carusyte Jan 29 '16 at 06:12