As I'm new to Liquibase, it might be my ignorance, but I wonder whether the Liquibase plug-in is being advised. I have a hard time making it work for me. I would like to generate a change log based on an existing database schema and a set of Spring/Hibernate classes. I came past many unclear error messages, but now I'm stuck on this:
- INFO 11/4/16 8:44 PM: liquibase-hibernate: Reading hibernate configuration hibernate:spring:nu.yona.server.subscriptions.entities?dialect=org.hibernate.dialect.HSQLDialect
- INFO 11/4/16 8:44 PM: liquibase-hibernate: Found package nu.yona.server.subscriptions.entities
- INFO 11/4/16 8:44 PM: liquibase-hibernate: Found dialect org.hibernate.dialect.HSQLDialect
- Unexpected error running Liquibase: Unable to resolve persistence unit root URL
- SEVERE 11/4/16 8:44 PM: liquibase: Unable to resolve persistence unit root URL
- liquibase.exception.DatabaseException: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
Given the amount of unclear messages and the little information I could find on the internet, I started to wonder whether I'm trying something that nobody uses.
My question is actually twofold: should I move on with the Liquibase Gradle plug-in? If so, any idea what could cause the above issue?
For your infomation: this is the Gradle file that I use:
- description = 'Database initializer'
- buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:$project.ext.springBootVersion")
- classpath("io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE")
- classpath('se.transmode.gradle:gradle-docker:1.2')
- classpath 'net.researchgate:gradle-release:2.3.4'
- classpath 'org.liquibase:liquibase-gradle-plugin:1.2.1'
- classpath("org.hsqldb:hsqldb:2.3.3")
- classpath("org.liquibase.ext:liquibase-hibernate4:3.6")
- classpath("org.springframework.boot:spring-boot-starter-data-jpa:1.4.1.RELEASE")
- classpath("org.springframework.batch:spring-batch-core:3.0.7.RELEASE")
- }
- }
- apply plugin: 'java'
- apply plugin: 'idea'
- apply plugin: 'spring-boot'
- apply plugin: 'io.spring.dependency-management'
- apply plugin: 'docker'
- apply plugin: 'net.researchgate.release'
- apply plugin: 'liquibase'
- jar {
- baseName = 'DatabaseInitializer'
- }
- release {
- failOnCommitNeeded = true
- tagTemplate = 'adminservice-${version}'
- git {
- requireBranch = 'yd-40-changes-for-building|master'
- }
- }
- dependencies {
- compile project(":core")
- compile("org.springframework.boot:spring-boot-starter-data-jpa:1.4.1.RELEASE")
- compile("org.springframework.batch:spring-batch-core:3.0.7.RELEASE")
- }
- group = 'yonadev'
- task buildDocker(type: Docker, dependsOn: bootRepackage) {
- tag = "${project.group}/yonahsqldb"
- push = true
- applicationName = jar.baseName
- dockerfile = file('src/main/docker/Dockerfile')
- doFirst {
- copy {
- from bootRepackage
- into stageDir
- rename "${jar.baseName}-${jar.version}-${bootRepackage.classifier}", "${jar.baseName}"
- }
- copy {
- from 'data'
- into "$stageDir/data"
- }
- }
- }
- bootRun {
- enableAssertions=true
- systemProperties = [
- 'spring.datasource.url': "jdbc:hsqldb:file:../YonaDB",
- 'spring.batch.initializer.enabled': "true",
- 'spring.jpa.hibernate.ddl-auto': "update"
- ]
- }
- bootRepackage {
- classifier = "full"
- }
- liquibase {
- activities {
- main {
- changeLogFile 'changelog.groovy'
- url 'jdbc:hsqldb:hsql://yonadbserver/xdb'
- referenceUrl 'hibernate:spring:nu.yona.server.subscriptions.entities?dialect=org.hibernate.dialect.HSQLDialect'
- username 'sa'
- password ''
- changeLogParameters([ myToken: 'myvalue',
- second: 'secondValue'])
- }
- }
- // runList = project.ext.runList
- runList = 'main'
- }