简体   繁体   English

使用maven分发spring-boot应用程序的替代方法(spring-boot:repackage除外)

[英]Alternatives to distribute spring-boot application using maven (other than spring-boot:repackage)

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 据我所知,spring-boot-maven-plugin已经提供了一种将整个应用程序分发到胖可执行jar文件中的方法: 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: 但是,有时我们不想要一个胖的可执行jar,它封装了所有模块,依赖项和配置文件,例如,可能是一个zip / tar文件,其中的主要模块都包含在jar中,并且与jar一起用于不同平台的启动脚本以及相关性lib文件夹和配置文件下的文件位于conf文件夹中:

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? 如何在这种结构中进行分配?

Use the Maven Appassembler plugin - their program example seems to be close to what you're looking for. 使用Maven Appassembler插件 -他们的program示例似乎与您想要的很接近。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM