jar{ enabled false } bootJar { enabled true } dependencies { //引入smartcity-common模块 implementation project(':smartcity-common') implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.cloud:spring-cloud-starter-oauth2' implementation 'org.springframework.cloud:spring-cloud-starter-security' compile('mysql:mysql-connector-java') //数据源连接池 //compile('com.alibaba:druid:1.1.6') compile('com.alibaba:druid-spring-boot-starter:1.1.9') //分页插件 compile('com.github.pagehelper:pagehelper-spring-boot-starter:1.2.10') testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } } test { useJUnitPlatform() } /* remotes { //开发环境服务器 devServer { host = '114.135.61.188' port = 30154 user = 'root' password = '1qaz2wsx!' } //测试环境服务器 sitServer { host = '114.135.61.188' port = 30154 user = 'root' password = '1qaz2wsx!' } } */ task deploy(dependsOn:bootJar){ doLast { println 'deploy...' ssh.run { session(remotes.sitServer){ put from: 'build/libs/smartcity-web.jar', into: '/opt/sit/smartcity-web' def result = execute '/opt/sit/stop-port.sh 8324' println result execute 'nohup java -jar /opt/sit/smartcity-web/smartcity-web.jar --spring.profiles.active=sit >/dev/null &' } } } }