用gradle把springboot项目打包成jar


```

用gradle把springboot项目打包成jar

```
### build.gradle 中添加

buildscript { 
    repositories {
        mavenLocal()
        maven { url "http://*.*.*.*:*/nexus/content/groups/public/" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.4.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'

 

 

buildscript代码块中的配置是打包所用到的依赖,不是项目用到的依赖。
repositories 与 dependencies 与外边的配置方法一致。本次主题主要用到的是引入spring-boot-gradle-plugin插件


### 执行构建命令

gradle bootRepackage


###启动jar包命令

java -jar *.jar &

 

 

 

作者:简体字丶冯;

QQ:564372931


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM