build.gradle 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. //---------------------- 公共部分 ----------------------//
  2. //系统启动初始化:自动下载插件
  3. buildscript {
  4. repositories {
  5. maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } //阿里云
  6. }
  7. }
  8. //公共仓库配置
  9. repositories {
  10. maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } //阿里云
  11. }
  12. //---------------------- JAVA 编译插件 ----------------------//
  13. apply plugin: 'java-library'
  14. //JAVA 文件编码
  15. compileJava.options.encoding = 'UTF-8'
  16. tasks.withType(JavaCompile) {
  17. options.debug = true //输出行号
  18. options.debugOptions.debugLevel = "source,lines,vars" //输出行号
  19. options.encoding = "UTF-8"
  20. }
  21. //JAVA兼容性设置
  22. sourceCompatibility = '1.8'
  23. targetCompatibility = '1.8'
  24. //---------------------- 变量定义 ---------------------
  25. def ccProjectName='ccframe'
  26. def ccPubVersion='2.0-SNAPSHOT' //正式TAG版本请修改此版本号
  27. def ccReleaseTime=new Date().format("yyyy-MM-dd_HH-mm-ss", TimeZone.getTimeZone("Asia/Shanghai"))
  28. def ccBuildNumber=System.getenv().BUILD_NUMBER == null ? 'debug' : System.getenv().BUILD_NUMBER?.toInteger()
  29. def ccSvnVersion=System.getenv().SVN_REVISION == null ? 'debug' : System.getenv().SVN_REVISION?.toInteger()
  30. //---------------------- JAR 打包插件 ----------------------//
  31. apply plugin: 'application'
  32. mainClassName = 'org.ccframe.app.App'
  33. jar {
  34. manifestContentCharset 'utf-8'
  35. metadataCharset 'utf-8'
  36. manifest {
  37. attributes 'Main-Class': 'org.ccframe.app.App'
  38. }
  39. }
  40. task clearJar(type: Delete) {
  41. delete "$buildDir\\libs\\lib"
  42. }
  43. task copyJar(type: Copy, dependsOn: 'clearJar') { //提取所有的jar
  44. from configurations.compileClasspath{
  45. exclude 'lombok*'
  46. exclude 'jsp-api*'
  47. }
  48. into "$buildDir\\libs\\lib"
  49. }
  50. /*
  51. bootJar {//配合jar服务器启动.bat脚本
  52. // 例外所有的jar
  53. excludes = ["*.jar"]
  54. // lib目录的清除和复制任务
  55. dependsOn clearJar
  56. dependsOn copyJar
  57. // 指定依赖包的路径
  58. manifest {
  59. attributes "Manifest-Version": 1.0,
  60. 'Class-Path': configurations.compileClasspath.files.collect { "lib/$it.name" }.join(' ')
  61. }
  62. }
  63. //还有个https://github.com/spring-projects-experimental/spring-boot-thin-launcher有空试试
  64. */
  65. /* ----------------- buildship 整合 --------------- */
  66. apply plugin: 'java'
  67. apply plugin: 'eclipse'
  68. eclipse {
  69. classpath {
  70. downloadSources = true
  71. defaultOutputDir = file('/war/WEB-INF/classes')
  72. file {
  73. whenMerged {
  74. //兼容eclipse2020设置:test输出目录要与main的不一样
  75. entries.each {
  76. if(it.path.startsWith('src/main')){
  77. println it
  78. it.output = null
  79. }
  80. }
  81. }
  82. }
  83. }
  84. }
  85. //----------------------- 编译JAR依赖配置 ------------------------//
  86. configurations.all {
  87. transitive = false //默认不自动关联依赖,以免打包过大
  88. resolutionStrategy.cacheChangingModulesFor 0, 'seconds' //立即检查而不是要过24h,因为有snapshot
  89. exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j' // 关联发布时,强制移除冲突的jar
  90. exclude group: 'ch.qos.logback' // 关联发布时,强制移除冲突的jar
  91. exclude group: 'pull-parser'
  92. }
  93. dependencies {
  94. //参与编译与发布.
  95. implementation 'org.springframework.boot:spring-boot:2.3.2.RELEASE'
  96. implementation 'org.springframework.boot:spring-boot-starter:2.3.2.RELEASE'
  97. implementation 'org.springframework.boot:spring-boot-starter-web:2.3.2.RELEASE'
  98. implementation 'org.springframework.boot:spring-boot-autoconfigure:2.3.2.RELEASE'
  99. implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.3.2.RELEASE'
  100. implementation 'org.springframework.boot:spring-boot-starter-freemarker:2.3.2.RELEASE'
  101. implementation 'org.springframework.boot:spring-boot-starter-log4j2:2.3.2.RELEASE'
  102. implementation 'org.springframework.boot:spring-boot-starter-tomcat:2.3.2.RELEASE'
  103. implementation ('org.springframework.boot:spring-boot-starter-data-elasticsearch:2.3.2.RELEASE') {
  104. exclude group: 'org.springframework.data', module: 'spring-data-elasticsearch'
  105. }
  106. implementation 'org.springframework.boot:spring-boot-starter-security:2.3.2.RELEASE'
  107. implementation 'org.springframework.boot:spring-boot-starter-quartz:2.3.2.RELEASE'
  108. implementation 'org.springframework.boot:spring-boot-starter-actuator:2.3.2.RELEASE'
  109. // implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive:2.3.2.RELEASE'
  110. implementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.37'
  111. implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:9.0.37'
  112. implementation 'javax.servlet:javax.servlet-api:4.0.1'
  113. implementation 'commons-fileupload:commons-fileupload:1.3.3'
  114. implementation 'commons-io:commons-io:2.5'
  115. implementation 'commons-jxpath:commons-jxpath:1.3'
  116. implementation 'commons-lang:commons-lang:2.6'
  117. implementation 'org.apache.commons:commons-lang3:3.11'
  118. implementation 'commons-collections:commons-collections:3.2.2'
  119. implementation 'org.apache.commons:commons-collections4:4.4'
  120. implementation 'commons-codec:commons-codec:1.15'
  121. implementation 'org.springframework:spring-core:5.2.8.RELEASE'
  122. implementation 'org.springframework:spring-beans:5.2.8.RELEASE'
  123. implementation 'org.springframework:spring-web:5.2.8.RELEASE'
  124. implementation 'org.springframework:spring-webmvc:5.2.8.RELEASE'
  125. implementation 'org.springframework:spring-context:5.2.8.RELEASE'
  126. implementation 'org.springframework:spring-context-support:5.2.8.RELEASE'
  127. implementation 'org.springframework:spring-tx:5.2.8.RELEASE'
  128. implementation 'org.springframework:spring-orm:5.2.8.RELEASE'
  129. implementation 'org.springframework:spring-aop:5.2.8.RELEASE'
  130. implementation 'org.springframework:spring-jdbc:5.2.8.RELEASE'
  131. implementation 'org.springframework:spring-expression:5.2.8.RELEASE'
  132. implementation 'org.apache.poi:poi:3.14' //3.16要commons-collection4,700多k,暂不更新
  133. implementation 'org.apache.poi:poi-ooxml:3.14'
  134. implementation 'org.apache.poi:poi-ooxml-schemas:3.14'
  135. implementation 'org.apache.poi:poi-scratchpad:3.14'
  136. implementation 'org.apache.xmlbeans:xmlbeans:3.1.0'
  137. implementation 'stax:stax-api:1.0.1'
  138. //权限认证
  139. implementation 'org.springframework.security:spring-security-config:5.3.3.RELEASE'
  140. implementation 'org.springframework.security:spring-security-core:5.3.3.RELEASE'
  141. implementation 'org.springframework.security:spring-security-web:5.3.3.RELEASE'
  142. // implementation 'org.springframework.security:spring-security-jwt:1.1.1.RELEASE'
  143. implementation 'org.springframework.data:spring-data-commons:2.2.13.RELEASE'
  144. implementation 'org.springframework.data:spring-data-jpa:2.2.13.RELEASE'
  145. implementation 'org.springframework.data:spring-data-elasticsearch:3.2.13.RELEASE' //锁定版本 https://mvnrepository.com/artifact/org.springframework.data/spring-data-releasetrain/Moore-SR13
  146. // implementation 'org.springframework.data:spring-data-redis:2.2.13.RELEASE' //lettuce驱动需要
  147. // implementation 'org.springframework.data:spring-data-keyvalue:2.2.13.RELEASE' //lettuce驱动需要
  148. implementation 'org.apache.lucene:lucene-analyzers-common:7.7.3'
  149. implementation 'org.apache.lucene:lucene-core:7.7.3'
  150. implementation 'org.apache.lucene:lucene-highlighter:7.7.3'
  151. implementation 'org.apache.lucene:lucene-join:7.7.3'
  152. implementation 'org.apache.lucene:lucene-memory:7.7.3'
  153. implementation 'org.apache.lucene:lucene-queries:7.7.3'
  154. implementation 'org.apache.lucene:lucene-queryparser:7.7.3'
  155. implementation 'org.apache.lucene:lucene-spatial:7.7.3'
  156. implementation 'org.apache.lucene:lucene-suggest:7.7.3'
  157. implementation 'org.apache.lucene:lucene-sandbox:7.7.3'
  158. implementation 'org.apache.lucene:lucene-misc:7.7.3'
  159. implementation 'org.apache.lucene:lucene-grouping:7.7.3'
  160. implementation 'joda-time:joda-time:2.9.9'
  161. implementation 'org.elasticsearch:elasticsearch-core:6.8.19'
  162. implementation 'org.elasticsearch:elasticsearch:6.8.19'
  163. implementation 'org.elasticsearch:elasticsearch-x-content:6.8.19'
  164. implementation 'org.elasticsearch.plugin:transport-netty4-client:6.8.19'
  165. implementation 'org.elasticsearch.plugin:rank-eval-client:6.8.19'
  166. implementation 'org.apache.commons:commons-pool2:2.8.0'
  167. implementation 'org.apache.httpcomponents:httpclient:4.5.12'
  168. implementation 'org.apache.httpcomponents:httpcore:4.4.13'
  169. implementation 'org.apache.httpcomponents:httpcore-nio:4.4.13'
  170. implementation 'org.apache.httpcomponents:httpasyncclient:4.1.4'
  171. //ES本地服务额外需要
  172. implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.11.0'
  173. implementation 'org.apache.logging.log4j:log4j-core:2.14.1'
  174. implementation 'org.elasticsearch:elasticsearch-cli:6.8.19'
  175. implementation 'com.tdunning:t-digest:3.2'
  176. implementation 'org.elasticsearch:jna:5.5.0'
  177. //implementation files('/lib/plugin-classloader-6.8.19.jar')
  178. //implementation 'org.codelibs.elasticsearch.lib:plugin-classloader:6.8.19'
  179. implementation 'org.codelibs.elasticsearch.lib:plugin-classloader:6.8.12'
  180. implementation 'org.hibernate:hibernate-core:5.4.19.Final'
  181. implementation 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final'
  182. implementation 'org.hibernate.common:hibernate-commons-annotations:5.1.0.Final'
  183. implementation 'net.bytebuddy:byte-buddy-dep:1.10.14'
  184. implementation 'org.ow2.asm:asm:8.0.1'
  185. implementation 'org.ow2.asm:asm-commons:8.0.1'
  186. implementation 'org.jboss:jandex:2.1.3.Final'
  187. implementation 'jakarta.persistence:jakarta.persistence-api:2.2.3'
  188. implementation 'org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE'
  189. implementation 'org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE'
  190. // implementation 'io.lettuce:lettuce-core:5.3.1.RELEASE'
  191. // implementation 'io.netty:netty-all:4.1.50.Final'
  192. // implementation 'io.projectreactor:reactor-core:3.3.6.RELEASE'
  193. // implementation 'org.reactivestreams:reactive-streams:1.0.3'
  194. implementation 'redis.clients:jedis:2.9.3' //j2cache限制不要升级
  195. implementation 'io.netty:netty-all:4.1.50.Final'
  196. // implementation 'io.springfox:springfox-swagger-ui:2.9.2' //改用knife4j ui
  197. implementation 'io.springfox:springfox-swagger-common:2.9.2'
  198. implementation 'io.springfox:springfox-swagger2:2.9.2'
  199. implementation 'io.springfox:springfox-spring-web:2.9.2'
  200. implementation 'io.swagger:swagger-models:1.5.21'
  201. implementation 'io.swagger:swagger-annotations:1.5.21'
  202. implementation 'io.springfox:springfox-core:2.9.2'
  203. implementation 'io.springfox:springfox-spi:2.9.2'
  204. implementation 'io.springfox:springfox-schema:2.9.2'
  205. implementation 'org.mapstruct:mapstruct:1.2.0.Final'
  206. implementation 'io.github.wilson-he:swagger2-spring-boot-starter:1.1.2'
  207. implementation 'com.google.guava:failureaccess:1.0.1'
  208. implementation ('com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.9') {
  209. exclude group: 'com.github.xiaoymin', module: 'knife4j-spring'
  210. }
  211. implementation 'com.github.xiaoymin:knife4j-spring-ui:2.0.9'
  212. implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1'
  213. implementation 'org.slf4j:slf4j-api:1.7.30'
  214. implementation 'commons-logging:commons-logging:1.2'
  215. implementation 'org.apache.logging.log4j:log4j-api:2.14.1'
  216. // implementation 'org.apache.logging.log4j:log4j-core:2.14.1'
  217. implementation 'org.yaml:snakeyaml:1.26'
  218. implementation 'com.fasterxml.jackson.core:jackson-annotations:2.11.0'
  219. implementation 'com.fasterxml.jackson.core:jackson-core:2.11.0'
  220. implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
  221. implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.0'
  222. implementation 'org.freemarker:freemarker:2.3.30'
  223. implementation 'com.alibaba:druid:1.1.23'
  224. implementation 'mysql:mysql-connector-java:8.0.21'
  225. implementation 'org.redisson:redisson:3.15.6' //redis分布式扩展支持
  226. implementation 'org.jboss.marshalling:jboss-marshalling:2.0.9.Final'
  227. implementation 'org.jboss.marshalling:jboss-marshalling-river:2.0.9.Final'
  228. //hanlp词法分析器 http://hanlp.linrunsoft.com/index.html
  229. implementation 'com.hankcs:hanlp:portable-1.7.1'
  230. implementation 'com.google.guava:guava:29.0-jre'
  231. implementation 'com.carrotsearch:hppc:0.8.2'
  232. implementation 'org.slf4j:jul-to-slf4j:1.7.30'
  233. implementation 'org.springframework:spring-jcl:5.2.8.RELEASE'
  234. implementation 'com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0'
  235. implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0'
  236. implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0'
  237. implementation 'net.oschina.j2cache:j2cache-spring-boot2-starter:2.8.0-release'
  238. implementation 'net.oschina.j2cache:j2cache-core:2.8.2-release'
  239. implementation 'net.oschina.j2cache:j2cache-springcache:2.8.0-release'
  240. implementation 'de.ruedigermoeller:fst:2.57'
  241. implementation 'org.objenesis:objenesis:3.1'
  242. implementation 'com.github.ben-manes.caffeine:caffeine:2.8.4'
  243. implementation 'com.alibaba:fastjson:1.2.62'
  244. implementation 'com.fasterxml:classmate:1.5.1'
  245. implementation 'org.javassist:javassist:3.27.0-GA'
  246. implementation 'org.jboss.logging:jboss-logging:3.4.1.Final'
  247. implementation 'org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1'
  248. implementation 'org.dom4j:dom4j:2.1.3'
  249. implementation 'jakarta.annotation:jakarta.annotation-api:1.3.5'
  250. implementation 'net.coobird:thumbnailator:0.4.8'
  251. implementation 'org.dbunit:dbunit:2.5.4' //不要升级
  252. implementation 'org.apache.ant:ant:1.9.9'
  253. implementation 'antlr:antlr:2.7.7'
  254. implementation 'io.jsonwebtoken:jjwt:0.9.1' //token方案
  255. //集群定时任务
  256. implementation 'org.quartz-scheduler:quartz:2.3.2'
  257. implementation 'org.quartz-scheduler:quartz-jobs:2.3.2'
  258. implementation 'com.github.binarywang:weixin-java-miniapp:3.8.0' //微信小程序二维码支持
  259. implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.8.19'
  260. implementation 'org.elasticsearch.client:elasticsearch-rest-client:6.8.19'
  261. implementation 'org.elasticsearch.plugin:lang-mustache-client:6.8.19'
  262. implementation 'uk.org.lidalia:sysout-over-slf4j:1.0.2' //system out err stacktrace转slf4j,便于统一日志
  263. //implementation 'net.logstash.logback:logstash-logback-encoder:6.4'
  264. //implementation 'org.sejda.imageio:webp-imageio:0.1.6' //webp的imageIO,用于小图
  265. implementation 'io.minio:minio:8.4.1' //minio分布式文件
  266. implementation 'com.squareup.okhttp3:okhttp:4.9.0' //minio用的http client
  267. implementation 'com.squareup.okio:okio:2.8.0' //minio用的http client
  268. implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.10'
  269. implementation 'org.apache.shardingsphere:sharding-jdbc-spring-boot-starter:4.1.1' //分库分表的支持
  270. implementation 'org.apache.shardingsphere:shardingsphere-common:4.1.1'
  271. implementation 'org.apache.shardingsphere:sharding-spring-boot-util:4.1.1'
  272. implementation 'org.apache.shardingsphere:sharding-transaction-spring:4.1.1'
  273. implementation 'org.apache.shardingsphere:sharding-jdbc-core:4.1.1'
  274. implementation 'org.apache.shardingsphere:shardingsphere-pluggable:4.1.1'
  275. implementation 'org.apache.shardingsphere:sharding-transaction-core:4.1.1'
  276. implementation 'org.apache.shardingsphere:shardingsphere-sql-parser-sql92:4.1.1'
  277. implementation 'org.apache.shardingsphere:shardingsphere-sql-parser-engine:4.1.1'
  278. implementation 'org.apache.shardingsphere:shardingsphere-route:4.1.1'
  279. implementation 'org.apache.shardingsphere:shardingsphere-executor:4.1.1'
  280. implementation 'org.apache.shardingsphere:shardingsphere-spi:4.1.1'
  281. implementation 'org.apache.shardingsphere:shardingsphere-sql-parser-binder:4.1.1'
  282. implementation 'org.apache.shardingsphere:shardingsphere-rewrite-engine:4.1.1'
  283. implementation 'org.apache.shardingsphere:shardingsphere-merge:4.1.1'
  284. implementation 'org.apache.shardingsphere:shardingsphere-pluggable:4.1.1'
  285. implementation 'org.apache.shardingsphere:master-slave-core-route:4.1.1'
  286. implementation 'org.apache.shardingsphere:sharding-core-common:4.1.1'
  287. implementation 'org.apache.shardingsphere:sharding-core-route:4.1.1'
  288. implementation 'org.apache.shardingsphere:sharding-core-api:4.1.1'
  289. implementation 'org.apache.shardingsphere:sharding-core-rewrite:4.1.1'
  290. implementation 'org.apache.shardingsphere:encrypt-core-rewrite:4.1.1'
  291. implementation 'org.apache.shardingsphere:encrypt-core-merge:4.1.1'
  292. implementation 'org.apache.shardingsphere:sharding-core-execute:4.1.1'
  293. implementation 'org.apache.shardingsphere:sharding-core-merge:4.1.1'
  294. implementation 'org.apache.shardingsphere:encrypt-core-common:4.1.1'
  295. implementation 'org.apache.shardingsphere:encrypt-core-api:4.1.1'
  296. implementation 'org.apache.shardingsphere:shardingsphere-sql-parser-spi:4.1.1'
  297. implementation 'org.apache.shardingsphere:shardingsphere-sql-parser-mysql:4.1.1'
  298. implementation 'org.apache.shardingsphere:shardingsphere-sql-parser-statement:4.1.1'
  299. implementation 'org.codehaus.groovy:groovy:2.4.5'
  300. implementation 'org.antlr:antlr4-runtime:4.7.2'
  301. //二维码servlet使用
  302. implementation 'com.google.zxing:core:3.4.1'
  303. implementation 'com.google.zxing:javase:3.4.1'
  304. //监控
  305. implementation 'org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.2.RELEASE'
  306. implementation 'org.latencyutils:LatencyUtils:2.0.3'
  307. implementation 'io.micrometer:micrometer-core:1.5.3'
  308. implementation 'org.springframework.boot:spring-boot-actuator:2.3.2.RELEASE'
  309. //其它编译但是不需要发布的
  310. compileOnly 'javax.servlet.jsp:jsp-api:2.2'
  311. compileOnly 'org.projectlombok:lombok:1.18.28'
  312. annotationProcessor 'org.projectlombok:lombok:1.18.28'
  313. //参与测试不进行发布
  314. testImplementation 'junit:junit:4.8' //4.11的版本需要额外包
  315. }