profile_prod.gradle 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. dependencies {
  2. implementation "mysql:mysql-connector-java"
  3. liquibaseRuntime "mysql:mysql-connector-java"
  4. testImplementation "org.testcontainers:mysql"
  5. }
  6. def profiles = "prod"
  7. if (project.hasProperty("no-liquibase")) {
  8. profiles += ",no-liquibase"
  9. }
  10. if (project.hasProperty("api-docs")) {
  11. profiles += ",api-docs"
  12. }
  13. if (project.hasProperty("e2e")) {
  14. profiles += ",e2e"
  15. }
  16. springBoot {
  17. buildInfo()
  18. }
  19. bootRun {
  20. args = ["--spring.profiles.active=${profiles}"]
  21. }
  22. processResources {
  23. inputs.property('version', version)
  24. inputs.property('springProfiles', profiles)
  25. filesMatching("**/application.yml") {
  26. filter {
  27. it.replace("#project.version#", version)
  28. }
  29. filter {
  30. it.replace("#spring.profiles.active#", profiles)
  31. }
  32. }
  33. }
  34. task integrationTest(type: Test) {
  35. maxHeapSize = "1G"
  36. useJUnitPlatform()
  37. description = "Execute integration tests."
  38. group = "verification"
  39. include "**/*IT*", "**/*IntTest*"
  40. testLogging {
  41. events 'FAILED', 'SKIPPED'
  42. }
  43. systemProperty('spring.profiles.active', 'testprod')
  44. systemProperty('java.security.egd', 'file:/dev/./urandom')
  45. // uncomment if the tests reports are not generated
  46. // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
  47. // ignoreFailures true
  48. reports.html.enabled = false
  49. }
  50. integrationTest.dependsOn test