I recently added a plugin for database migration in grails 3.0.11 application. The problem is that when I try to run the application, I get the following error:
ERROR grails.boot.GrailsApp - Application startup failed
Exception in thread "main" org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'springLiquibase_dataSource':
Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException:
java.lang.IllegalArgumentException: Script text to compile cannot be null!
It looks like he cannot find the changelog.xml file in my grails-app / migrations folder. My build.gradle file contains:
buildscript {
dependencies {
classpath "org.grails.plugins:database-migration:2.0.0.RC1"
}
}
and
sourceSets {
main {
resources {
srcDir 'grails-app/migrations'
}
}
}
I also added the following lines to the application.groovy file:
grails.plugin.databasemigration.updateOnStart = true
grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.xml']
I would really appreciate any advice on how to work with the database plugin.
Edit:
I created a changelog.xml file using the command $grails dbm-create-changelog
I also added to build.gradle (as suggested by the team $grails plugin-info database-migration):
dependencies {
compile "org.grails.plugins:database-migration:2.0.0.RC1"
}
then I changed it to (after the official documentation):
dependencies {
runtime "org.grails.plugins:database-migration:2.0.0.RC1"
}
and then (as suggested by the manual for a startup error), I force the lipibase:
dependencies {
compile 'org.liquibase:liquibase-core:3.3.2'
runtime 'org.grails.plugins:database-migration:2.0.0.RC1'
}
and
dependencies {
compile 'org.liquibase:liquibase-core:3.3.2'
compile 'org.grails.plugins:database-migration:2.0.0.RC1'
}
The problem remains: java.lang.IllegalArgumentException: Script text to compile cannot be null!