Guest User

Untitled

a guest
Oct 24th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. }
  5. dependencies {
  6. classpath('org.springframework.boot:spring-boot-gradle-plugin:1.5.7.RELEASE')
  7. // tag::build[]
  8. classpath('se.transmode.gradle:gradle-docker:1.2')
  9. // end::build[]
  10. classpath('org.liquibase:liquibase-gradle-plugin:1.2.4')
  11. classpath('org.postgresql:postgresql:42.1.4')
  12. }
  13. }
  14.  
  15. apply plugin: 'java'
  16. apply plugin: 'eclipse'
  17. apply plugin: 'idea'
  18. apply plugin: 'org.springframework.boot'
  19. // tag::plugin[]
  20. apply plugin: 'docker'
  21. // end::plugin[]
  22. apply plugin: 'org.liquibase.gradle'
  23.  
  24. bootRun {
  25. systemProperty 'spring.profiles.active', System.properties['spring.profiles.active']
  26. }
  27.  
  28.  
  29. def changeLog = "$projectDir/src/main/resources/db/db.changelog-master.yaml"
  30.  
  31. task('dev') << {
  32. println 'executing dev'
  33. liquibase{
  34. activities {
  35. main {
  36. changeLogFile changeLog
  37. url 'postgresql://localhost/mydatabase'
  38. username 'postgres'
  39. password 'mysecret'
  40. driver 'org.postgresql.Driver'
  41. }
  42. }
  43. }
  44. }
  45.  
  46. jar {
  47. baseName = 'applicationTestLiquibasegradle'
  48. version = '0.0.3'
  49. }
  50.  
  51. // This is used as the docker image prefix (org)
  52. group = 'com.cropmetrics'
  53. version = '0.0.3'
  54. sourceCompatibility = 1.8
  55.  
  56. // tag::task[]
  57. task buildDocker(type: Docker, dependsOn: build) {
  58. applicationName = jar.baseName
  59. dockerfile = file('Dockerfile')
  60. doFirst {
  61. copy {
  62. from jar
  63. into "${stageDir}/target"
  64. }
  65. }
  66. }
  67. // end::task[]
  68.  
  69.  
  70. repositories {
  71. mavenCentral()
  72. }
  73.  
  74.  
  75. dependencies {
  76. compileOnly('org.projectlombok:lombok:1.16.18')
  77. compile('org.springframework.boot:spring-boot-starter')
  78. compile('org.springframework.boot:spring-boot-starter-web')
  79. compile('org.springframework.boot:spring-boot-starter-data-jpa')
  80. // JPA Data (We are going to use Repositories, Entities, Hibernate, etc...)
  81. compile 'org.springframework.boot:spring-boot-starter-data-jpa'
  82.  
  83. compile('org.liquibase:liquibase-core')
  84. compile('org.postgresql:postgresql:42.1.4.jre7')
  85. testCompile('org.springframework.boot:spring-boot-starter-test')
  86. }
  87.  
  88. gradle task dev update
  89.  
  90. * What went wrong:
  91. Execution failed for task ':update'.
  92. > liquibase.exception.LiquibaseException: Unexpected error running Liquibase: liquibase.exception.DatabaseException: Connection could not be created to postgresql://localhost/cropmetricsdatabase with driver org.postgresql.Driver. Possibly the wrong driver for the given database URL
Add Comment
Please, Sign In to add comment