```
用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