springboot gradle打包,以及部署
2018-03-30 16:48
543 查看
找到这两个东西Gradle Tasks 下面有自己的Gradle项目,打开build找到clear,如果控制台显示success,在双击build下面的build等待打成jar包,如果springboot是2.0 需要将所有的配置指向application.yml, 在项目下面的目录下面打开build里面的libs里面的jar就是打好的jar包,通过shell连接服务器,放在下面还要将application.yml文件放到下面,通过java -jar xxxx.jar --spring.config.location=application.yml 先看前端是否可以启动,如果启动了按ctrl+c 退出,在后台启动 nohup java -jar xxxx.jar --spring.config.location=application.yml & 启动项目 通过ps -ef | grep java 查看是否启动, 如果关闭执行 kill -9 线程 杀死进程
java -jar rental-0.0.1.jar --spring.config.location=application.yml rental-0.0.1
java -jar rental-0.0.1.jar --spring.config.location=application.yml &
build.gradle:
buildscript {
ext {
springBootVersion = '1.5.10.RELEASE'
jarName = project.name
mainClassName = 'com.ly.ApiApplication'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
group = 'com.ly'
version = '0.0.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
repositories {
maven {url 'http://172.18.115.187:8081/repository/maven-releases/'}
mavenCentral()
}
springBoot {
executable = true
}
dependencies {
//compile('org.springframework.cloud:spring-cloud-starter-config')
//compile("org.springframework.retry:spring-retry")
compile group: 'org.springframework.boot',name: 'spring-boot-starter-actuator'
compile group: 'org.springframework.boot',name: 'spring-boot-starter-security'
// compile('org.springframework.cloud:spring-cloud-starter-bus-amqp')
//compile('org.springframework.cloud:spring-cloud-starter-stream-rabbit')
//compile('org.springframework.cloud:spring-cloud-starter-hystrix')
compile("org.mybatis.generator:mybatis-generator-core:1.3.2")
compile('com.ly.cloud:boot-common-config:0.0.10')
compile('com.ly.cloud:ly-rpc-starter:0.0.7')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.cloud:spring-cloud-starter-eureka')
compile('org.springframework.cloud:spring-cloud-starter-feign')
compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1')
compile("org.springframework.boot:spring-boot-starter-aop")
compile("io.springfox:springfox-swagger2:2.7.0")
compile("io.springfox:springfox-swagger-ui:2.7.0")
compile("com.alibaba:fastjson:1.2.33")
compile("org.apache.commons:commons-lang3:3.5")
compile("commons-beanutils:commons-beanutils:1.9.3")
compile("com.google.guava:guava:21.0")
compile group: 'com.alibaba', name: 'druid', version: '1.1.6'
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.45'
compile("org.apache.commons:commons-dbcp2:2.1.1")
compile group: 'commons-io', name: 'commons-io', version: '2.6'
//compile('org.springframework.cloud:spring-cloud-starter-sleuth')
//compile('org.springframework.cloud:spring-cloud-sleuth-zipkin')
//compile('org.springframework.boot:spring-boot-starter-data-mongodb')
//compile('org.springframework.boot:spring-boot-starter-data-redis')
//compile('org.springframework.boot:spring-boot-starter-data-mongodb-reactive')
//compile('org.springframework.boot:spring-boot-starter-webflux')
//testCompile('org.springframework.boot:spring-boot-starter-test')
//compile('com.ly.boot:ly-websocket-starter:0.0.5')
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Edgware.SR1"
}
}
jar.manifest.attributes 'Main-Class': mainClassName
jar.baseName = jarName
相关文章推荐
- springboot gradle打包,以及部署
- springboot_01热部署以及打包
- 使用gradle构建springboot工程的以及部署springboot到linux服务
- spring boot 项目打包jar 启动方式,以及 可能遇到的坑。
- SpringBoot热部署与打包
- 【Springboot】 学习一 应用打包部署
- Springboot 打包部署
- 打包SpringBoot工程并部署
- Spring Boot 打包部署
- 初识Springboot 以及IDEA maven打包记录
- [置顶] Eclipse新建Spring-boot项目,打包部署并输出HelloWord
- 将Spring Boot应用打包成可部署的War文件
- Spring boot(4)-应用打包部署
- springboot如何测试打包部署
- 将springboot项目打包部署到tomcat中
- Spring boot(4)-应用打包部署
- 将springboot打包部署到服务器(Tomcat)上
- springboot打包war部署至tomcat
- spring boot 打包和部署