build.gradle 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. plugins {
  2. id "io.spring.dependency-management" version "1.0.7.RELEASE" apply false
  3. id "org.springframework.boot" version "2.1.4.RELEASE" apply false
  4. id "io.freefair.lombok" version "5.0.0-rc4" apply false
  5. id 'com.bmuschko.docker-spring-boot-application' version '6.3.0' apply false
  6. }
  7. allprojects {
  8. group 'com.usoftchina.saas'
  9. version '1.0.0-SNAPSHOT'
  10. }
  11. def env = System.getProperty("profile") ?: "dev"
  12. def dockerGroup = System.getProperty("dockerGroup") ?: "saas"
  13. subprojects { Project subproject ->
  14. if (!subproject.name.matches(".*-(core|common|api|service|dto|server|client|sdk|starter|task)")) {
  15. return
  16. }
  17. if (env == "dev") {
  18. subproject.version = '1.0.0.SNAPSHOT'
  19. } else {
  20. subproject.version = '1.0.0.RELEASE'
  21. }
  22. apply plugin: 'java'
  23. apply plugin: 'idea'
  24. apply plugin: 'maven'
  25. apply plugin: 'maven-publish'
  26. apply plugin: 'io.spring.dependency-management'
  27. apply plugin: 'io.freefair.lombok'
  28. sourceCompatibility = 1.8
  29. targetCompatibility = 1.8
  30. [compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
  31. ext {
  32. springBootVersion = '2.1.4.RELEASE'
  33. // dependencies
  34. alibabaThreadLocal = 'com.alibaba:transmittable-thread-local:2.10.2'
  35. mysqlConnector = 'mysql:mysql-connector-java:6.0.6'
  36. mybatisSpringBoot = 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1'
  37. pageHelperSpringBoot = 'com.github.pagehelper:pagehelper-spring-boot-starter:1.2.7'
  38. fastjson = 'com.alibaba:fastjson:1.2.47'
  39. guava = 'com.google.guava:guava:18.0'
  40. fastdfs = 'com.github.tobato:fastdfs-client:1.26.3'
  41. commonCompress = 'org.apache.commons:commons-compress:1.18'
  42. jjwt = 'io.jsonwebtoken:jjwt:0.7.0'
  43. poi = 'org.apache.poi:poi-ooxml:3.17'
  44. zxing = 'com.google.zxing:javase:3.3.0'
  45. aliyunSmsCore = 'com.aliyun:aliyun-java-sdk-core:4.0.3'
  46. qcloudSmsSdk = 'com.github.qcloudsms:qcloudsms:1.0.6'
  47. repoBaseUrl = "http://maven.ubtob.com/artifactory"
  48. snapshotUrl = "$repoBaseUrl/libs-snapshot-local"
  49. releaseUrl = "$repoBaseUrl/libs-release-local"
  50. dockerGroup = "$dockerGroup"
  51. dockerRegistry = env == 'dev' ? '10.1.81.1:4000' : '10.10.100.200:5000'
  52. }
  53. repositories {
  54. mavenLocal()
  55. maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
  56. maven { url "https://repo.spring.io/libs-milestone" }
  57. maven { url "http://maven.ubtob.com/artifactory/libs-release-local" }
  58. maven { url "http://maven.ubtob.com/artifactory/libs-snapshot-local" }
  59. maven { url "http://maven.ubtob.com/artifactory/ext-release-local" }
  60. maven { url "https://artifactory.uuzcc.cn/artifactory/libs-snapshot-local" }
  61. mavenCentral()
  62. }
  63. dependencyManagement {
  64. imports {
  65. mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
  66. }
  67. }
  68. lombok {
  69. config['lombok.equalsAndHashCode.callSuper'] = 'call'
  70. }
  71. task sourcesJar(type: Jar) {
  72. from sourceSets.main.allJava
  73. classifier 'sources'
  74. }
  75. artifacts {
  76. archives sourcesJar
  77. }
  78. // *-server不需要publish
  79. if (subproject.name.matches(".*-(core|common|api|service|dto|client|sdk|starter|task)")) {
  80. publishing {
  81. publications {
  82. plugins(MavenPublication) {
  83. from components.java
  84. artifact sourcesJar
  85. }
  86. }
  87. repositories {
  88. maven {
  89. url subproject.version.endsWith('-SNAPSHOT') ? snapshotUrl : releaseUrl
  90. credentials {
  91. username = 'yingp'
  92. password = '111111'
  93. }
  94. }
  95. }
  96. }
  97. }
  98. }