Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

304 lines
11KB

  1. import org.gradle.internal.os.OperatingSystem
  2. buildscript {
  3. repositories {
  4. mavenLocal()
  5. mavenCentral()
  6. maven { url "https://repo.spring.io/plugins-snapshot" }
  7. maven { url "https://plugins.gradle.org/m2/" }
  8. }
  9. dependencies {
  10. classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}"
  11. classpath "io.spring.gradle:propdeps-plugin:0.0.8-SNAPSHOT"
  12. classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.5.2"
  13. //jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here
  14. }
  15. }
  16. plugins {
  17. id "org.sonarqube" version "2.6.2"
  18. id "net.ltgt.apt-eclipse" version "0.19"
  19. id "net.ltgt.apt-idea" version "0.19"
  20. id "net.ltgt.apt" version "0.19"
  21. id "io.spring.dependency-management" version "1.0.6.RELEASE"
  22. id "com.github.node-gradle.gulp" version "1.3.0"
  23. id 'org.liquibase.gradle' version '2.0.1'
  24. //jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
  25. }
  26. apply plugin: 'java'
  27. sourceCompatibility=1.8
  28. targetCompatibility=1.8
  29. // Until JHipster supports JDK 9
  30. assert System.properties['java.specification.version'] == '1.8'
  31. apply plugin: 'maven'
  32. apply plugin: 'org.springframework.boot'
  33. apply plugin: 'war'
  34. apply plugin: 'propdeps'
  35. apply plugin: 'com.github.node-gradle.gulp'
  36. apply plugin: 'io.spring.dependency-management'
  37. apply plugin: 'idea'
  38. dependencyManagement {
  39. imports {
  40. mavenBom 'io.github.jhipster:jhipster-dependencies:' + jhipster_dependencies_version
  41. //jhipster-needle-gradle-dependency-management - JHipster will add additional dependencies management here
  42. }
  43. }
  44. defaultTasks 'bootRun'
  45. group = 'vn.azteam'
  46. version = '0.0.1-SNAPSHOT'
  47. description = ''
  48. bootWar {
  49. mainClassName = 'vn.azteam.tpf.TPFApp'
  50. }
  51. war {
  52. enabled = true
  53. classifier = 'original'
  54. }
  55. springBoot {
  56. mainClassName = 'vn.azteam.tpf.TPFApp'
  57. buildInfo()
  58. }
  59. if (OperatingSystem.current().isWindows()) {
  60. // https://stackoverflow.com/questions/40037487/the-filename-or-extension-is-too-long-error-using-gradle
  61. task classpathJar(type: Jar) {
  62. dependsOn configurations.runtime
  63. appendix = 'classpath'
  64. doFirst {
  65. manifest {
  66. attributes 'Class-Path': configurations.runtime.files.collect {
  67. it.toURI().toURL().toString().replaceFirst(/file:\/+/, '/').replaceAll(' ', '%20')
  68. }.join(' ')
  69. }
  70. }
  71. }
  72. bootRun {
  73. dependsOn classpathJar
  74. doFirst {
  75. classpath = files("$buildDir/classes/java/main", "$buildDir/resources/main", classpathJar.archivePath)
  76. }
  77. }
  78. }
  79. test {
  80. exclude '**/CucumberTest*'
  81. // uncomment if the tests reports are not generated
  82. // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
  83. // ignoreFailures true
  84. reports.html.enabled = false
  85. }
  86. task testReport(type: TestReport) {
  87. destinationDir = file("$buildDir/reports/tests")
  88. reportOn test
  89. }
  90. apply from: 'gradle/docker.gradle'
  91. apply from: 'gradle/sonar.gradle'
  92. //jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
  93. if (project.hasProperty('prod')) {
  94. apply from: 'gradle/profile_prod.gradle'
  95. } else {
  96. apply from: 'gradle/profile_dev.gradle'
  97. }
  98. if (!project.hasProperty('runList')) {
  99. project.ext.runList = 'main'
  100. }
  101. project.ext.diffChangelogFile = 'src/main/resources/config/liquibase/changelog/' + new Date().format('yyyyMMddHHmmss') + '_changelog.xml'
  102. liquibase {
  103. activities {
  104. main {
  105. driver 'com.mysql.jdbc.Driver'
  106. url 'jdbc:mysql://1.0.0.4:3306/smf'
  107. username 'root'
  108. password 'P@ssw0rdfarm'
  109. changeLogFile 'src/main/resources/config/liquibase/master.xml'
  110. defaultSchemaName 'smf'
  111. logLevel 'debug'
  112. classpath 'src/main/resources/'
  113. }
  114. diffLog {
  115. driver 'com.mysql.jdbc.Driver'
  116. url 'jdbc:mysql://1.0.0.4:3306/smf'
  117. username 'root'
  118. password 'P@ssw0rdfarm'
  119. changeLogFile project.ext.diffChangelogFile
  120. referenceUrl 'hibernate:spring:vn.azteam.smf.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy'
  121. defaultSchemaName 'smf'
  122. logLevel 'debug'
  123. classpath "$buildDir/classes/java/main"
  124. }
  125. }
  126. runList = project.ext.runList
  127. }
  128. configurations {
  129. providedRuntime
  130. compile.exclude module: "spring-boot-starter-tomcat"
  131. }
  132. repositories {
  133. mavenLocal()
  134. mavenCentral()
  135. jcenter()
  136. //jhipster-needle-gradle-repositories - JHipster will add additional repositories
  137. }
  138. dependencies {
  139. // Use ", version: jhipster_dependencies_version, changing: true" if you want
  140. // to use a SNAPSHOT release instead of a stable release
  141. // https://mvnrepository.com/artifact/com.google.firebase/firebase-admin
  142. compile group: 'com.google.firebase', name: 'firebase-admin', version: '7.0.1'
  143. // https://mvnrepository.com/artifact/org.casbin/casbin-spring-boot-starter
  144. compile group: 'org.casbin', name: 'casbin-spring-boot-starter', version: '0.0.9'
  145. compile group: "io.github.jhipster", name: "jhipster-framework"
  146. compile "org.apache.poi:poi:4.1.2"
  147. compile "org.apache.poi:poi-ooxml:4.1.2"
  148. compile "org.apache.poi:ooxml-schemas:1.4"
  149. // https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans
  150. compile group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '3.1.0'
  151. compile "org.springframework.boot:spring-boot-starter-cache"
  152. compile "io.dropwizard.metrics:metrics-core"
  153. compile "io.dropwizard.metrics:metrics-jcache"
  154. compile "io.dropwizard.metrics:metrics-json"
  155. compile "io.dropwizard.metrics:metrics-jvm"
  156. compile "io.dropwizard.metrics:metrics-servlet"
  157. compile "io.dropwizard.metrics:metrics-servlets"
  158. compile "io.prometheus:simpleclient"
  159. compile "io.prometheus:simpleclient_dropwizard"
  160. compile "io.prometheus:simpleclient_servlet"
  161. compile "net.logstash.logback:logstash-logback-encoder"
  162. compile "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
  163. compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
  164. compile "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5"
  165. compile "com.fasterxml.jackson.core:jackson-annotations"
  166. compile "com.fasterxml.jackson.core:jackson-databind"
  167. compile "com.fasterxml.jackson.module:jackson-module-afterburner"
  168. compile "com.opencsv:opencsv:4.5"
  169. compile "com.ryantenney.metrics:metrics-spring"
  170. compile "javax.cache:cache-api"
  171. compile "org.hibernate:hibernate-core"
  172. compile "com.zaxxer:HikariCP"
  173. compile "org.apache.commons:commons-lang3"
  174. compile "commons-io:commons-io"
  175. compile "javax.transaction:javax.transaction-api"
  176. compile "org.ehcache:ehcache"
  177. compile "org.hibernate:hibernate-jcache"
  178. compile "org.hibernate:hibernate-entitymanager"
  179. compile "org.hibernate:hibernate-envers"
  180. compile "org.hibernate.validator:hibernate-validator"
  181. compile "org.liquibase:liquibase-core"
  182. compile "com.mattbertolini:liquibase-slf4j"
  183. liquibaseRuntime "org.liquibase:liquibase-core"
  184. liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibase_hibernate5_version}"
  185. liquibaseRuntime sourceSets.main.compileClasspath
  186. compile "org.springframework.boot:spring-boot-loader-tools"
  187. compile "org.springframework.boot:spring-boot-starter-mail"
  188. compile "org.springframework.boot:spring-boot-starter-logging"
  189. compile "org.springframework.boot:spring-boot-starter-actuator"
  190. compile "org.springframework.boot:spring-boot-starter-aop"
  191. compile "org.springframework.boot:spring-boot-starter-data-jpa"
  192. compile "org.springframework.boot:spring-boot-starter-data-elasticsearch"
  193. // Spring Data Jest dependencies for Elasticsearch
  194. compile ("com.github.vanroy:spring-boot-starter-data-jest") {
  195. exclude module: 'commons-logging'
  196. }
  197. // log4j needed to create embedded elasticsearch instance
  198. runtime "org.apache.logging.log4j:log4j-api:2.8.2"
  199. runtime "org.apache.logging.log4j:log4j-core:2.8.2"
  200. // end of Spring Data Jest dependencies
  201. compile "org.springframework.boot:spring-boot-starter-security"
  202. compile ("org.springframework.boot:spring-boot-starter-web") {
  203. exclude module: 'spring-boot-starter-tomcat'
  204. }
  205. compile "org.springframework.boot:spring-boot-starter-json"
  206. compile "org.springframework.boot:spring-boot-starter-undertow"
  207. compile "org.springframework.boot:spring-boot-starter-websocket"
  208. compile "org.springframework.boot:spring-boot-starter-thymeleaf"
  209. compile "org.zalando:problem-spring-web:0.24.0-RC.0"
  210. compile "org.springframework.boot:spring-boot-starter-cloud-connectors"
  211. compile "org.springframework.security:spring-security-config"
  212. compile "org.springframework.security:spring-security-data"
  213. compile "org.springframework.security:spring-security-web"
  214. compile "org.springframework.security:spring-security-messaging"
  215. compile "io.jsonwebtoken:jjwt-api"
  216. runtime "io.jsonwebtoken:jjwt-impl"
  217. runtime "io.jsonwebtoken:jjwt-jackson"
  218. // compile ("io.springfox:springfox-swagger2") {
  219. // exclude module: 'mapstruct'
  220. // }
  221. // https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui
  222. implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.7.0'
  223. // compile "io.springfox:springfox-bean-validators"
  224. compile "mysql:mysql-connector-java"
  225. liquibaseRuntime "mysql:mysql-connector-java"
  226. compile "org.mapstruct:mapstruct-jdk8:${mapstruct_version}"
  227. annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}"
  228. annotationProcessor "org.hibernate:hibernate-jpamodelgen"
  229. annotationProcessor ("org.springframework.boot:spring-boot-configuration-processor") {
  230. exclude group: 'com.vaadin.external.google', module: 'android-json'
  231. }
  232. testCompile "com.jayway.jsonpath:json-path"
  233. testCompile ("org.springframework.boot:spring-boot-starter-test") {
  234. exclude group: 'com.vaadin.external.google', module: 'android-json'
  235. }
  236. testCompile "org.springframework.security:spring-security-test"
  237. testCompile "org.springframework.boot:spring-boot-test"
  238. testCompile "org.assertj:assertj-core"
  239. testCompile "junit:junit"
  240. testCompile "org.mockito:mockito-core"
  241. testCompile "com.mattbertolini:liquibase-slf4j"
  242. testCompile "org.hamcrest:hamcrest-library"
  243. testCompile "com.h2database:h2"
  244. //jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
  245. // https://mvnrepository.com/artifact/org.projectlombok/lombok
  246. provided group: 'org.projectlombok', name: 'lombok', version: '1.18.4'
  247. }
  248. task cleanResources(type: Delete) {
  249. delete 'build/resources'
  250. }
  251. wrapper {
  252. gradleVersion = '4.10.2'
  253. }
  254. task stage(dependsOn: 'bootWar') {
  255. }
  256. //if (project.hasProperty('nodeInstall')) {
  257. node {
  258. download = true
  259. version = "${node_version}"
  260. npmVersion = "${npm_version}"
  261. yarnVersion = "${yarn_version}"
  262. }
  263. //}
  264. bootWar.dependsOn war
  265. compileJava.dependsOn processResources
  266. processResources.dependsOn cleanResources,bootBuildInfo
  267. bootBuildInfo.mustRunAfter cleanResources