build.gradle 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. buildscript {
  2. ext {
  3. springBootVersion = '2.2.5.RELEASE'
  4. junit_version = '4.12'
  5. commons_io_version = '2.6'
  6. commons_lang3_version = '3.5'
  7. commons_codec_version = '1.13'
  8. mysql_connector_version = '8.0.19'
  9. mybatis_plus_boot_version = '3.3.1'
  10. dynamicDataSourceVersion = '3.1.1'
  11. swagger_version = '2.9.2'
  12. logstashVersion = '5.3'
  13. set('springCloudVersion', 'Hoxton.SR6')
  14. set('springBootAdminVersion', '2.1.4')
  15. springCloudAlibabaVersion='2.2.1.RELEASE'
  16. }
  17. repositories {
  18. maven { url 'https://maven.aliyun.com/repository/central' }
  19. maven { url 'https://maven.aliyun.com/repository/public' }
  20. maven { url 'https://maven.aliyun.com/repository/spring' }
  21. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  22. maven { url 'http://repo.spring.io/plugins-release' }
  23. }
  24. dependencies {
  25. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  26. classpath('se.transmode.gradle:gradle-docker:1.2')
  27. }
  28. }
  29. repositories {
  30. maven {
  31. credentials {
  32. username 'gwIWlU'
  33. password 'F74dqgicoK'
  34. }
  35. url 'https://repo.rdc.aliyun.com/repository/128622-snapshot-pBgJ3q'
  36. }
  37. maven { url 'https://maven.aliyun.com/repository/public' }
  38. maven { url 'https://maven.aliyun.com/repository/central' }
  39. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  40. }
  41. apply plugin: 'java'
  42. apply plugin: 'eclipse'
  43. apply plugin: 'org.springframework.boot'
  44. apply plugin: 'io.spring.dependency-management'
  45. apply plugin: 'maven-publish'
  46. apply plugin: 'docker'
  47. apply plugin: 'application'
  48. group = "cn.tonyandmoney.tuon"
  49. version = "2.2.5.5"
  50. dependencyManagement {
  51. imports {
  52. mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}"
  53. mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  54. mavenBom 'org.springframework.session:spring-session-bom:Bean-SR2'
  55. }
  56. }
  57. dependencies {
  58. compile('org.springframework.cloud:spring-cloud-starter')
  59. compile('org.springframework.cloud:spring-cloud-starter-openfeign')
  60. compile('org.springframework.cloud:spring-cloud-starter-netflix-ribbon')
  61. compile('org.springframework.cloud:spring-cloud-starter-bus-amqp')
  62. compile('org.springframework.retry:spring-retry')
  63. // commons
  64. compile("commons-io:commons-io:$commons_io_version")
  65. compile("org.apache.commons:commons-lang3:$commons_lang3_version")
  66. compile("org.apache.httpcomponents:httpclient:4.5.11")
  67. compile("commons-codec:commons-codec:$commons_codec_version")
  68. compile("javax.servlet:javax.servlet-api:4.0.1")
  69. //AOP
  70. compile("org.springframework.boot:spring-boot-starter-aop")
  71. compile 'org.springframework.session:spring-session-data-redis'
  72. compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9")
  73. compile('com.fasterxml.jackson.module:jackson-module-kotlin:2.9.9')
  74. compile('org.springframework.boot:spring-boot-starter-actuator')
  75. //cache
  76. compile('org.springframework.boot:spring-boot-starter-cache')
  77. compile('org.springframework.boot:spring-boot-starter-jdbc')
  78. compile 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
  79. compile 'com.squareup.okhttp3:logging-interceptor:3.12.0'
  80. compile('com.squareup.okhttp3:okhttp:3.12.0')
  81. compile('org.springframework.boot:spring-boot-starter-web')
  82. compile('org.springframework.boot:spring-boot-starter-webflux')
  83. compile('org.springframework.boot:spring-boot-starter-undertow')
  84. compile('org.springframework.boot:spring-boot-starter-websocket')
  85. compile('org.springframework.boot:spring-boot-starter-thymeleaf')
  86. // db
  87. compile("mysql:mysql-connector-java:$mysql_connector_version")
  88. compile("com.baomidou:mybatis-plus-boot-starter:$mybatis_plus_boot_version")
  89. compile("com.baomidou:mybatis-plus-generator:$mybatis_plus_boot_version")
  90. compile("com.baomidou:dynamic-datasource-spring-boot-starter:${dynamicDataSourceVersion}")
  91. compile("org.apache.velocity:velocity-engine-core:2.2")
  92. // swagger
  93. compile("io.springfox:springfox-swagger2:$swagger_version")
  94. compile("io.springfox:springfox-swagger-ui:$swagger_version")
  95. // compile group: 'com.github.xiaoymin', name: 'swagger-bootstrap-ui', version: '1.9.6'
  96. compile group: 'com.github.xiaoymin', name: 'knife4j-spring-boot-starter', version: '2.0.4'
  97. compile("com.google.code.gson:gson:2.8.5")
  98. compile("com.tencentcloudapi:tencentcloud-sdk-java:3.1.62")
  99. compile group: 'org.jsoup', name: 'jsoup', version: '1.13.1'
  100. compile group: 'com.alibaba', name: 'fastjson', version: '1.2.72'
  101. compile group: 'com.auth0', name: 'jwks-rsa', version: '0.9.0'
  102. //compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
  103. compile group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.1'
  104. runtime group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.1'
  105. runtime group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.1'
  106. compile group: 'org.json', name: 'json', version: '20140107'
  107. // compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.64'
  108. compile ("net.logstash.logback:logstash-logback-encoder:${logstashVersion}")
  109. //集成nacos注册中心和配置中心
  110. compile("com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:${springCloudAlibabaVersion}")
  111. compile("com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:${springCloudAlibabaVersion}")
  112. compile 'org.redisson:redisson:3.13.4'
  113. }
  114. docker{
  115. baseImage 'openjdk:8-jre-alpine'
  116. maintainer 'niantuo 976056042@qq.com'
  117. registry 'registry.cn-beijing.aliyuncs.com'
  118. }
  119. //如果依赖改成api,而不用compile,这个copy中configurations.runtime 则没有值
  120. task dockerBuilder(type: Docker) {
  121. registry='registry.cn-beijing.aliyuncs.com/tuon-pub'
  122. applicationName = "spring-cloud-libs"
  123. tagVersion = jar.getArchiveVersion().get()
  124. addFile("./jar/","/libs/")
  125. entryPoint(["sh"])
  126. doFirst {
  127. copy {
  128. from configurations.runtime
  129. into "${stageDir}/jar"
  130. }
  131. }
  132. push = true
  133. }
  134. bootJar { enabled = false }
  135. jar { enabled = true }
  136. task sourceJar(type: Jar) {
  137. from sourceSets.main.allJava
  138. }
  139. publishing {
  140. repositories {
  141. maven {
  142. credentials {
  143. username 'gwIWlU' // 仓库发布用户名
  144. password 'F74dqgicoK' // 仓库发布用户密码
  145. }
  146. url 'https://repo.rdc.aliyun.com/repository/128622-snapshot-pBgJ3q' // 仓库地址
  147. }
  148. }
  149. publications {
  150. maven(MavenPublication) {
  151. groupId project.group
  152. artifactId project.name
  153. version version
  154. description '猪圈的基础依赖' // 说明描述
  155. from components.java
  156. //配置上传源码
  157. artifact sourceJar {
  158. classifier "sources"
  159. }
  160. }
  161. }
  162. }