You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. buildscript {
  2. ext {
  3. set('appname', "core")
  4. }
  5. }
  6. //引入自定义插件的方式
  7. plugins {
  8. id 'maven-publish' //添加maven plugin, 用于发布我们的jar
  9. }
  10. dependencies {
  11. implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis'
  12. implementation "org.springframework.cloud:spring-cloud-starter-openfeign"
  13. implementation group: 'redis.clients', name: 'jedis'
  14. implementation group: 'org.springframework.kafka', name: 'spring-kafka'
  15. //MYSQL
  16. /*
  17. runtimeOnly 'mysql:mysql-connector-java'
  18. */
  19. runtimeOnly 'com.oracle.database.jdbc:ojdbc8:19.10.0.0'
  20. }
  21. task commonCore(type:Jar){
  22. archiveBaseName='tj'
  23. archiveAppendix='common-core'
  24. archiveVersion='1.0.0-SNAPSHOT'
  25. archiveExtension='jar'
  26. from("build/classes/java/main/cn/com/taiji/common/")
  27. into('cn/com/taiji/common/')
  28. dependsOn(classes)
  29. }
  30. task template(type:Jar){
  31. archiveBaseName='tj'
  32. archiveAppendix='template'
  33. archiveVersion='1.0.0-SNAPSHOT'
  34. archiveExtension='jar'
  35. from("build/resources/main/template")
  36. into('template')
  37. dependsOn(classes)
  38. }
  39. task commCore(type:Jar){
  40. archiveBaseName='tj'
  41. archiveAppendix='comm-core'
  42. archiveVersion='1.0.0-SNAPSHOT'
  43. archiveExtension='jar'
  44. from("build/classes/java/main/cn/com/taiji/core"){
  45. include "**/manager/comm/**"
  46. include "**/manager/tools/**"
  47. include "**/model/comm/*"
  48. include "**/model/comm/protocol/*"
  49. include "**/model/comm/protocol/constraint/**"
  50. include "**/model/comm/protocol/constraintvalidators/**"
  51. include "**/model/comm/protocol/util/**"
  52. include "**/model/comm/protocol/valid/**"
  53. include "**/dict/common/**"
  54. }
  55. into('cn/com/taiji/core')
  56. dependsOn(classes)
  57. }
  58. task commKafka(type:Jar){
  59. archiveBaseName='tj'
  60. archiveAppendix='comm-kafka'
  61. archiveVersion='1.0.0-SNAPSHOT'
  62. archiveExtension='jar'
  63. from("build/classes/java/main/cn/com/taiji/core/manager/kafka/")
  64. into('cn/com/taiji/core/manager/kafka/')
  65. dependsOn(classes)
  66. }
  67. task entityCore(type:Jar){
  68. archiveBaseName='tj'
  69. archiveAppendix='entity-core'
  70. archiveVersion='1.0.0-SNAPSHOT'
  71. archiveExtension='jar'
  72. from("build/classes/java/main/cn/com/taiji/core"){
  73. include "**/entity/**"
  74. include "**/dict/**"
  75. include "**/repo/jpa/**"
  76. include "**/repo/request/**"
  77. }
  78. into('cn/com/taiji/core')
  79. dependsOn(classes)
  80. }
  81. task sampleProtocol(type:Jar){
  82. archiveBaseName='tj'
  83. archiveAppendix='sample-protocol'
  84. archiveVersion='1.0.0-SNAPSHOT'
  85. archiveExtension='jar'
  86. from("build/classes/java/main/cn/com/taiji/core/model/comm/protocol/sample")
  87. into('cn/com/taiji/core/model/comm/protocol/sample')
  88. dependsOn(classes)
  89. }
  90. task atsProtocol(type:Jar){
  91. archiveBaseName='tj'
  92. archiveAppendix='ats-protocol'
  93. archiveVersion='1.0.0-SNAPSHOT'
  94. archiveExtension='jar'
  95. from("build/classes/java/main/cn/com/taiji/core/model/comm/protocol/ats")
  96. into('cn/com/taiji/core/model/comm/protocol/ats')
  97. dependsOn(classes)
  98. }
  99. task inssProtocol(type:Jar){
  100. archiveBaseName='tj'
  101. archiveAppendix='inss-protocol'
  102. archiveVersion='1.0.0-SNAPSHOT'
  103. archiveExtension='jar'
  104. from("build/classes/java/main/cn/com/taiji/core/model/comm/protocol/inss")
  105. into('cn/com/taiji/core/model/comm/protocol/inss')
  106. dependsOn(classes)
  107. }
  108. task iasProtocol(type:Jar){
  109. archiveBaseName='tj'
  110. archiveAppendix='ias-protocol'
  111. archiveVersion='1.0.0-SNAPSHOT'
  112. archiveExtension='jar'
  113. from("build/classes/java/main/cn/com/taiji/core/model/comm/protocol/ias")
  114. into('cn/com/taiji/core/model/comm/protocol/ias')
  115. dependsOn(classes)
  116. }
  117. task blsProtocol(type:Jar){
  118. archiveBaseName='tj'
  119. archiveAppendix='bls-protocol'
  120. archiveVersion='1.0.0-SNAPSHOT'
  121. archiveExtension='jar'
  122. from("build/classes/java/main/cn/com/taiji/core/model/comm/protocol/bls")
  123. into('cn/com/taiji/core/model/comm/protocol/bls')
  124. dependsOn(classes)
  125. }
  126. task smpProtocol(type:Jar){
  127. archiveBaseName='tj'
  128. archiveAppendix='smp-protocol'
  129. archiveVersion='1.0.0-SNAPSHOT'
  130. archiveExtension='jar'
  131. from("build/classes/java/main/cn/com/taiji/core/model/comm/protocol/smp")
  132. into('cn/com/taiji/core/model/comm/protocol/smp')
  133. dependsOn(classes)
  134. }
  135. task packageCoreSrc(type:Jar){
  136. archiveBaseName='tj'
  137. archiveAppendix='core'
  138. archiveVersion='1.0.0-SNAPSHOT'
  139. archiveClassifier='sources'
  140. archiveExtension='jar'
  141. from("src/main/java/cn/com/taiji/")
  142. into('cn/com/taiji/')
  143. }
  144. publishing {
  145. publications {
  146. myPublicationCommonCore(MavenPublication) {
  147. groupId ="${groupname}"
  148. artifactId ='common-core'
  149. version ='1.0.0-SNAPSHOT'
  150. artifact commonCore
  151. artifact packageCoreSrc
  152. }
  153. myPublicationTemplate(MavenPublication) {
  154. groupId ="${groupname}"
  155. artifactId ='template'
  156. version ='1.0.0-SNAPSHOT'
  157. artifact template
  158. artifact packageCoreSrc
  159. }
  160. myPublication(MavenPublication) {
  161. groupId ="${groupname}"
  162. artifactId ='comm-core'
  163. version ='1.0.0-SNAPSHOT'
  164. artifact commCore
  165. artifact packageCoreSrc
  166. }
  167. myPublicationCommKafka(MavenPublication) {
  168. groupId ="${groupname}"
  169. artifactId ='comm-kafka'
  170. version ='1.0.0-SNAPSHOT'
  171. artifact commKafka
  172. artifact packageCoreSrc
  173. }
  174. myPublicationEntityCore(MavenPublication) {
  175. groupId ="${groupname}"
  176. artifactId ='entity-core'
  177. version ='1.0.0-SNAPSHOT'
  178. artifact entityCore
  179. artifact packageCoreSrc
  180. }
  181. myPublicationSampleProtocol(MavenPublication) {
  182. groupId ="${groupname}"
  183. artifactId ='sample-protocol'
  184. version ='1.0.0-SNAPSHOT'
  185. artifact sampleProtocol
  186. artifact packageCoreSrc
  187. }
  188. myPublicationAtsProtocol(MavenPublication) {
  189. groupId ="${groupname}"
  190. artifactId ='ats-protocol'
  191. version ='1.0.0-SNAPSHOT'
  192. artifact atsProtocol
  193. artifact packageCoreSrc
  194. }
  195. myPublicationInssProtocol(MavenPublication) {
  196. groupId ="${groupname}"
  197. artifactId ='inss-protocol'
  198. version ='1.0.0-SNAPSHOT'
  199. artifact inssProtocol
  200. artifact packageCoreSrc
  201. }
  202. myPublicationBlsProtocol(MavenPublication) {
  203. groupId ="${groupname}"
  204. artifactId ='bls-protocol'
  205. version ='1.0.0-SNAPSHOT'
  206. artifact blsProtocol
  207. artifact packageCoreSrc
  208. }
  209. myPublicationIasProtocol(MavenPublication) {
  210. groupId ="${groupname}"
  211. artifactId ='ias-protocol'
  212. version ='1.0.0-SNAPSHOT'
  213. artifact iasProtocol
  214. artifact packageCoreSrc
  215. }
  216. myPublicationSmpProtocol(MavenPublication) {
  217. groupId ="${groupname}"
  218. artifactId ='smp-protocol'
  219. version ='1.0.0-SNAPSHOT'
  220. artifact smpProtocol
  221. artifact packageCoreSrc
  222. }
  223. }//--publications
  224. /* repositories {
  225. maven {
  226. url = "http://192.168.60.179/repository/TJ-snapshots/"
  227. //认证用户和密码
  228. credentials {
  229. username 'wanglj'
  230. password 'Taiji@2020'
  231. }
  232. }
  233. }*/
  234. }
  235. test {
  236. useJUnitPlatform()
  237. }
  238. //gradle会检查一次依赖,设置每次build都进行检查。默认时间为24小时
  239. configurations.all {
  240. // check for updates every build
  241. resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
  242. }
  243. bootJar {
  244. archiveFileName="${appname}-boot.jar"
  245. mainClassName = "${groupname}.Application"
  246. }