base.gradle 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. configure(allprojects) { project ->
  2. apply plugin: 'org.springframework.boot'
  3. apply plugin: 'io.spring.dependency-management'
  4. apply plugin: 'java'
  5. apply plugin: 'idea'
  6. sourceCompatibility = 1.8
  7. targetCompatibility = 1.8
  8. configurations {
  9. developmentOnly
  10. runtimeClasspath {
  11. extendsFrom developmentOnly
  12. }
  13. compileOnly {
  14. extendsFrom annotationProcessor
  15. }
  16. }
  17. // java编译的时候缺省状态下会因为中文字符而失败
  18. [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
  19. dependencyManagement {
  20. overriddenByDependencies = true
  21. imports {
  22. mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
  23. mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  24. mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:${springCloudAlibabaVersion}"
  25. }
  26. dependencies {
  27. dependency "cec.dhc.plffwk.comps:cecdhc-plffwk-component:${cecdhcFwkCommsVersion}"
  28. dependency "cec.dhc.plffwk.tools:cecdhc-plffwk-utils:${cecdhcFwkUtilsVersion}"
  29. dependency "cec.dhc.devfwk.starters.knife4j:cecdhc-devfwk-starters-knife4j:${cecdhcKnife4jStarterVersion}"
  30. dependency "cec.dhc.devfwk.starters.web:cecdhc-devfwk-starters-web:${cecdhcWebStarterVersion}"
  31. dependency "cec.dhc.devfwk.starters.log:cecdhc-devfwk-starters-log:${cecdhcLogStarterVersion}"
  32. dependency "cec.dhc.devfwk.starters.redis:cecdhc-devfwk-starters-redis:${cecdhcRedisStarterVersion}"
  33. dependency "cec.dhc.devfwk.starters.nacos:cecdhc-devfwk-starters-nacos:${cecdhcNacosStarterVersion}"
  34. dependency "cec.dhc.devfwk.starters.mybatis:cecdhc-devfwk-starters-mybatis:${cecdhcMybatisStarterVersion}"
  35. dependency "cec.dhc.devfwk.starters.feign:cecdhc-devfwk-starters-feign:${cecdhcFeignStarterVersion}"
  36. dependency "cec.dhc.devfwk.starters.minio:cecdhc-devfwk-starters-minio:${cecdhcMinioStarterVersion}"
  37. dependency "cec.dhc.devfwk.starters.sentinel:cecdhc-devfwk-starters-sentinel:${cecdhSentinelStarterVersion}"
  38. dependency "cec.dhc.devfwk.starters.shiro:cecdhc-devfwk-starters-shiro:${cecdhcShiroStarterVersion}"
  39. dependency "cec.dhc.devfwk.starters.dingding:cecdhc-devfwk-starters-dingding:${cecdhcDingdingStarterVersion}"
  40. //security包
  41. dependency "org.springframework.security:spring-security-core:${springSecurityVersion}"
  42. dependency "org.springframework.security:spring-security-crypto:${springSecurityVersion}"
  43. dependency "org.springframework.security:spring-security-config:${springSecurityVersion}"
  44. dependency "org.springframework.security:spring-security-web:${springSecurityVersion}"
  45. dependency "org.springframework.security:spring-security-oauth2-jose:${springSecurityVersion}"
  46. dependency "org.springframework.security.oauth:spring-security-oauth2:${springSecurityOauth2Version}"
  47. dependency "org.springframework.security:spring-security-jwt:${springSecurityJwtVersion}"
  48. dependency "com.nimbusds:nimbus-jose-jwt:${nimbusJoseJwtVersion}"
  49. //其他包
  50. dependency "com.github.xiaoymin:knife4j-micro-spring-boot-starter:${knife4jVersion}"
  51. dependency "com.github.xiaoymin:knife4j-spring-ui:${knife4jVersion}"
  52. dependency "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
  53. dependency "com.baomidou:mybatis-plus-boot-starter:${mybatisPlusVersion}"
  54. dependency "com.baomidou:mybatis-plus-annotation:${mybatisPlusVersion}"
  55. dependency "javax.servlet:javax.servlet-api:${javaxServletVersion}"
  56. dependency "io.springfox:springfox-core:${springFoxVersion}"
  57. dependency "io.swagger:swagger-annotations:${swaggerAnnotationVersion}"
  58. dependency "org.redisson:redisson:${redissonVersion}"
  59. dependency "io.github.openfeign:feign-core:${feignCoreVersion}"
  60. dependency "cn.hutool:hutool-all:${hutoolVersion}"
  61. dependency "commons-io:commons-io:${commonsIoVersion}"
  62. dependency "commons-codec:commons-codec:${commonsCodecVersion}"
  63. dependency "org.apache.commons:commons-lang3:${commLang3Version}"
  64. dependency "org.apache.commons:commons-compress:${commonsCompressVersion}"
  65. dependency "commons-beanutils:commons-beanutils:${beanUtilsVersion}"
  66. dependency "org.apache.commons:commons-collections4:${collections4Version}"
  67. dependency "com.alibaba:transmittable-thread-local:${threadLocalVersion}"
  68. dependency "com.github.ben-manes.caffeine:caffeine:${caffeineVersion}"
  69. dependency "cn.stylefeng.roses:pinyin-sdk-pinyin4j:${pinyin4jVersion}"
  70. dependency "com.esotericsoftware:reflectasm:${reflectasmVersion}"
  71. dependency "org.lionsoul:ip2region-spring-boot-starter:${ip2regionVersion}"
  72. dependency "net.coobird:thumbnailator:${thumbnailatorVersion}"
  73. dependency "org.apache.commons:commons-pool2:${commonsPool2Version}"
  74. dependency "org.apache.httpcomponents:httpclient:${httpclientVersion}"
  75. dependency "org.apache.httpcomponents:httpmime:${httpclientVersion}"
  76. dependency "org.aspectj:aspectjweaver:${aspectjweaverVersion}"
  77. dependency "com.github.whvcse:easy-captcha:${easyCaptchaVersion}"
  78. dependency "com.github.ulisesbocchio:jasypt-spring-boot-starter:${jasyptSpringBootVersion}"
  79. dependency "com.aliyun:alibaba-dingtalk-service-sdk:${dingtalkVersion}"
  80. dependency "com.google.guava:guava:${guavaVersion}"
  81. dependency "com.google.code.gson:gson:${gsonVersion}"
  82. dependency "com.squareup.okhttp3:okhttp:${okhttpVersion}"
  83. dependency "io.minio:minio:${minioVersion}"
  84. dependency "org.springframework.security:spring-security-ldap:${securityLdapVersion}"
  85. //数据库驱动
  86. dependency "mysql:mysql-connector-java:${mysqlVersion}"
  87. dependency "com.oracle.database.jdbc:ojdbc8:${oracleVersion}"
  88. dependency "com.microsoft.sqlserver:sqljdbc4:${sqljdbcVersion}"
  89. dependency "org.postgresql:postgresql:${postgresqlVersion}"
  90. dependency "com.ibm.db2:db2jcc4:${db2Version}"
  91. dependency "net.sourceforge.jtds:jtds:${jtdsVersion}"
  92. dependency "io.jsonwebtoken:jjwt-api:${jjwtVersion}"
  93. dependency "com.auth0:java-jwt:${javaJwtVersion}"
  94. dependency "org.apache.shiro:shiro-spring:${shiroVersion}"
  95. dependency " org.springframework.session:spring-session-data-redis:${sessionDataRedisVersion}"
  96. dependency "com.alibaba.nacos:nacos-client:${nacosAlibabaVersion}"
  97. dependency "com.alibaba.nacos:nacos-common:${nacosAlibabaVersion}"
  98. dependency "com.alibaba.nacos:nacos-api:${nacosAlibabaVersion}"
  99. }
  100. }
  101. dependencies {
  102. compile "org.slf4j:slf4j-api:${slf4jApiVersion}"
  103. annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
  104. compile "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
  105. }
  106. test {
  107. useJUnitPlatform()
  108. }
  109. idea {
  110. module {
  111. inheritOutputDirs = true
  112. }
  113. }
  114. sourceSets {
  115. main {
  116. output.resourcesDir = java.outputDir
  117. }
  118. }
  119. }
  120. configure(rootProject) { project ->
  121. bootJar {
  122. enabled(true)
  123. }
  124. }
  125. configure(subprojects) { project ->
  126. jar {
  127. classifier = ''
  128. enabled(true)
  129. }
  130. bootJar {
  131. enabled = false
  132. }
  133. sourceSets {
  134. main {
  135. java {
  136. srcDir 'src/main/java'
  137. }
  138. resources {
  139. srcDir 'src/main/java'
  140. srcDir 'src/main/resources'
  141. }
  142. }
  143. }
  144. }
  145. if (JavaVersion.current().isJava8Compatible()) {
  146. allprojects {
  147. tasks.withType(Javadoc) {
  148. options.encoding = 'UTF-8'
  149. options.addStringOption('Xdoclint:none', '-quiet') // 关闭JDK1.8的doclint特性
  150. }
  151. }
  152. }
  153. configurations.all {
  154. resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
  155. resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
  156. //当遇到版本冲突时,强制使用指定版本号。(会自动下载,无需在dependencies中配置)
  157. resolutionStrategy.force([
  158. "com.alibaba.nacos:nacos-client:${nacosAlibabaVersion}",
  159. "com.alibaba.nacos:nacos-api:${nacosAlibabaVersion}",
  160. "com.alibaba.nacos:nacos-common:${nacosAlibabaVersion}"
  161. ])
  162. }