|
@@ -0,0 +1,185 @@
|
|
|
+buildscript {
|
|
|
+ ext {
|
|
|
+ springBootVersion = '2.2.5.RELEASE'
|
|
|
+ junit_version = '4.12'
|
|
|
+ commons_io_version = '2.6'
|
|
|
+ commons_lang3_version = '3.5'
|
|
|
+ commons_codec_version = '1.13'
|
|
|
+ mysql_connector_version = '8.0.19'
|
|
|
+ mybatis_plus_boot_version = '3.3.1'
|
|
|
+ dynamicDataSourceVersion = '3.1.1'
|
|
|
+ swagger_version = '2.9.2'
|
|
|
+ logstashVersion = '5.3'
|
|
|
+ set('springCloudVersion', 'Hoxton.SR6')
|
|
|
+ set('springBootAdminVersion', '2.1.4')
|
|
|
+ springCloudAlibabaVersion='2.2.1.RELEASE'
|
|
|
+ }
|
|
|
+ repositories {
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/central' }
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/public' }
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/spring' }
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
|
|
+ maven { url 'http://repo.spring.io/plugins-release' }
|
|
|
+ }
|
|
|
+
|
|
|
+ dependencies {
|
|
|
+ classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
|
|
+ classpath('se.transmode.gradle:gradle-docker:1.2')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+repositories {
|
|
|
+ maven {
|
|
|
+ credentials {
|
|
|
+ username 'gwIWlU'
|
|
|
+ password 'F74dqgicoK'
|
|
|
+ }
|
|
|
+ url 'https://repo.rdc.aliyun.com/repository/128622-snapshot-pBgJ3q'
|
|
|
+ }
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/public' }
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/central' }
|
|
|
+ maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
|
|
+}
|
|
|
+
|
|
|
+apply plugin: 'java'
|
|
|
+apply plugin: 'eclipse'
|
|
|
+apply plugin: 'org.springframework.boot'
|
|
|
+apply plugin: 'io.spring.dependency-management'
|
|
|
+apply plugin: 'maven-publish'
|
|
|
+apply plugin: 'docker'
|
|
|
+apply plugin: 'application'
|
|
|
+
|
|
|
+group = "cn.tonyandmoney.tuon"
|
|
|
+version = "2.2.5.5"
|
|
|
+
|
|
|
+dependencyManagement {
|
|
|
+ imports {
|
|
|
+ mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}"
|
|
|
+ mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
|
|
|
+ mavenBom 'org.springframework.session:spring-session-bom:Bean-SR2'
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+dependencies {
|
|
|
+ compile('org.springframework.cloud:spring-cloud-starter')
|
|
|
+ compile('org.springframework.cloud:spring-cloud-starter-openfeign')
|
|
|
+ compile('org.springframework.cloud:spring-cloud-starter-netflix-ribbon')
|
|
|
+ compile('org.springframework.cloud:spring-cloud-starter-bus-amqp')
|
|
|
+ compile('org.springframework.retry:spring-retry')
|
|
|
+ // commons
|
|
|
+ compile("commons-io:commons-io:$commons_io_version")
|
|
|
+ compile("org.apache.commons:commons-lang3:$commons_lang3_version")
|
|
|
+ compile("org.apache.httpcomponents:httpclient:4.5.11")
|
|
|
+ compile("commons-codec:commons-codec:$commons_codec_version")
|
|
|
+ compile("javax.servlet:javax.servlet-api:4.0.1")
|
|
|
+ //AOP
|
|
|
+ compile("org.springframework.boot:spring-boot-starter-aop")
|
|
|
+ compile 'org.springframework.session:spring-session-data-redis'
|
|
|
+ compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9")
|
|
|
+ compile('com.fasterxml.jackson.module:jackson-module-kotlin:2.9.9')
|
|
|
+
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-actuator')
|
|
|
+ //cache
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-cache')
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-jdbc')
|
|
|
+ compile 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
|
|
|
+
|
|
|
+ compile 'com.squareup.okhttp3:logging-interceptor:3.12.0'
|
|
|
+ compile('com.squareup.okhttp3:okhttp:3.12.0')
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-web')
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-webflux')
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-undertow')
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-websocket')
|
|
|
+ compile('org.springframework.boot:spring-boot-starter-thymeleaf')
|
|
|
+ // db
|
|
|
+ compile("mysql:mysql-connector-java:$mysql_connector_version")
|
|
|
+ compile("com.baomidou:mybatis-plus-boot-starter:$mybatis_plus_boot_version")
|
|
|
+ compile("com.baomidou:mybatis-plus-generator:$mybatis_plus_boot_version")
|
|
|
+ compile("com.baomidou:dynamic-datasource-spring-boot-starter:${dynamicDataSourceVersion}")
|
|
|
+
|
|
|
+ compile("org.apache.velocity:velocity-engine-core:2.2")
|
|
|
+ // swagger
|
|
|
+ compile("io.springfox:springfox-swagger2:$swagger_version")
|
|
|
+ compile("io.springfox:springfox-swagger-ui:$swagger_version")
|
|
|
+// compile group: 'com.github.xiaoymin', name: 'swagger-bootstrap-ui', version: '1.9.6'
|
|
|
+ compile group: 'com.github.xiaoymin', name: 'knife4j-spring-boot-starter', version: '2.0.4'
|
|
|
+ compile("com.google.code.gson:gson:2.8.5")
|
|
|
+ compile("com.tencentcloudapi:tencentcloud-sdk-java:3.1.62")
|
|
|
+ compile group: 'org.jsoup', name: 'jsoup', version: '1.13.1'
|
|
|
+ compile group: 'com.alibaba', name: 'fastjson', version: '1.2.72'
|
|
|
+ compile group: 'com.auth0', name: 'jwks-rsa', version: '0.9.0'
|
|
|
+ //compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
|
|
|
+ compile group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.1'
|
|
|
+ runtime group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.1'
|
|
|
+ runtime group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.1'
|
|
|
+ compile group: 'org.json', name: 'json', version: '20140107'
|
|
|
+// compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.64'
|
|
|
+
|
|
|
+ compile ("net.logstash.logback:logstash-logback-encoder:${logstashVersion}")
|
|
|
+
|
|
|
+ //集成nacos注册中心和配置中心
|
|
|
+ compile("com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:${springCloudAlibabaVersion}")
|
|
|
+ compile("com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:${springCloudAlibabaVersion}")
|
|
|
+
|
|
|
+ compile 'org.redisson:redisson:3.13.4'
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+docker{
|
|
|
+ baseImage 'openjdk:8-jre-alpine'
|
|
|
+ maintainer 'niantuo 976056042@qq.com'
|
|
|
+ registry 'registry.cn-beijing.aliyuncs.com'
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//如果依赖改成api,而不用compile,这个copy中configurations.runtime 则没有值
|
|
|
+task dockerBuilder(type: Docker) {
|
|
|
+ registry='registry.cn-beijing.aliyuncs.com/tuon-pub'
|
|
|
+ applicationName = "spring-cloud-libs"
|
|
|
+ tagVersion = jar.getArchiveVersion().get()
|
|
|
+ addFile("./jar/","/libs/")
|
|
|
+ entryPoint(["sh"])
|
|
|
+ doFirst {
|
|
|
+ copy {
|
|
|
+ from configurations.runtime
|
|
|
+ into "${stageDir}/jar"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ push = true
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+bootJar { enabled = false }
|
|
|
+jar { enabled = true }
|
|
|
+
|
|
|
+task sourceJar(type: Jar) {
|
|
|
+ from sourceSets.main.allJava
|
|
|
+}
|
|
|
+
|
|
|
+publishing {
|
|
|
+ repositories {
|
|
|
+ maven {
|
|
|
+ credentials {
|
|
|
+ username 'gwIWlU' // 仓库发布用户名
|
|
|
+ password 'F74dqgicoK' // 仓库发布用户密码
|
|
|
+ }
|
|
|
+ url 'https://repo.rdc.aliyun.com/repository/128622-snapshot-pBgJ3q' // 仓库地址
|
|
|
+ }
|
|
|
+ }
|
|
|
+ publications {
|
|
|
+ maven(MavenPublication) {
|
|
|
+ groupId project.group
|
|
|
+ artifactId project.name
|
|
|
+ version version
|
|
|
+ description '猪圈的基础依赖' // 说明描述
|
|
|
+ from components.java
|
|
|
+ //配置上传源码
|
|
|
+ artifact sourceJar {
|
|
|
+ classifier "sources"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|