Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath('org.springframework.boot:spring-boot-gradle-plugin:1.5.7.RELEASE')
- // tag::build[]
- classpath('se.transmode.gradle:gradle-docker:1.2')
- // end::build[]
- classpath('org.liquibase:liquibase-gradle-plugin:1.2.4')
- classpath('org.postgresql:postgresql:42.1.4')
- }
- }
- apply plugin: 'java'
- apply plugin: 'eclipse'
- apply plugin: 'idea'
- apply plugin: 'org.springframework.boot'
- // tag::plugin[]
- apply plugin: 'docker'
- // end::plugin[]
- apply plugin: 'org.liquibase.gradle'
- bootRun {
- systemProperty 'spring.profiles.active', System.properties['spring.profiles.active']
- }
- def changeLog = "$projectDir/src/main/resources/db/db.changelog-master.yaml"
- task('dev') << {
- println 'executing dev'
- liquibase{
- activities {
- main {
- changeLogFile changeLog
- url 'postgresql://localhost/mydatabase'
- username 'postgres'
- password 'mysecret'
- driver 'org.postgresql.Driver'
- }
- }
- }
- }
- jar {
- baseName = 'applicationTestLiquibasegradle'
- version = '0.0.3'
- }
- // This is used as the docker image prefix (org)
- group = 'com.cropmetrics'
- version = '0.0.3'
- sourceCompatibility = 1.8
- // tag::task[]
- task buildDocker(type: Docker, dependsOn: build) {
- applicationName = jar.baseName
- dockerfile = file('Dockerfile')
- doFirst {
- copy {
- from jar
- into "${stageDir}/target"
- }
- }
- }
- // end::task[]
- repositories {
- mavenCentral()
- }
- dependencies {
- compileOnly('org.projectlombok:lombok:1.16.18')
- compile('org.springframework.boot:spring-boot-starter')
- compile('org.springframework.boot:spring-boot-starter-web')
- compile('org.springframework.boot:spring-boot-starter-data-jpa')
- // JPA Data (We are going to use Repositories, Entities, Hibernate, etc...)
- compile 'org.springframework.boot:spring-boot-starter-data-jpa'
- compile('org.liquibase:liquibase-core')
- compile('org.postgresql:postgresql:42.1.4.jre7')
- testCompile('org.springframework.boot:spring-boot-starter-test')
- }
- gradle task dev update
- * What went wrong:
- Execution failed for task ':update'.
- > 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