文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

SpringBoot多种打包方法

2023-10-24 09:18

关注

方法1. 使用mvn插件打包(推荐)

pom代码

                                        org.apache.maven.plugins                maven-surefire-plugin                2.22.2                                    true                                                        org.apache.maven.plugins                maven-compiler-plugin                3.8.1                                    1.8                    1.8                    UTF-8                                                        org.springframework.boot                spring-boot-maven-plugin                                    true                    com.iristar.TestApplication                                                                            repackage                        repackage                                                                                        

启动脚本
set path=%PATH%;dlljava -jar ./target/evalserver-1.0-SNAPSHOT.jar spring.config.addition-location=./application.properties     #!/bin/bashexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./dll java -jar ./target/evalserver-1.0-SNAPSHOT.jar spring.config.addition-location=./application.properties 

方法2. 使用 idea的Artifacts打包

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png


方法3. 使用package打包

pom代码

                                        org.springframework.boot                spring-boot-maven-plugin                                                        -Dfile.encoding=UTF-8                    com.iristar.center.ht.ApiServer                                                                                        org.apache.maven.plugins                maven-surefire-plugin                                    true                                                                    org.apache.maven.plugins                maven-compiler-plugin                                    1.8                    1.8                    utf8                                            -XDignore.symbol.file                                        true                                                        org.codehaus.mojo                appassembler-maven-plugin                2.0.0                                                            Make Assembly                                                package                        assemble                                                                                                                                            unix                        windows                                                            ${project.build.directory}/product                                        lib                                                            bin                                        conf                                        true                                        src/main/resources                    flat                    UTF-8                    logs                    tmp                                            com.iristar.center.ht.ApiServerApiServer            -server        -Xmx2G        -Xms2G        -Dfile.encoding=UTF-8