grails / grails-database-migration

Grails® framework Database Migration Plugin
Apache License 2.0
98 stars 115 forks source link

Grails 5.1.1 broken: No such property: instance for class: liquibase.servicelocator.ServiceLocator #257

Closed abcfy2 closed 2 years ago

abcfy2 commented 2 years ago

Task List

Steps to Reproduce

Just generate a rest-api from https://start.grails.org/

curl -O https://start.grails.org/myapp.zip -d profile=rest-api -d features=hibernate5

Add this plugin:

buildscript {
   dependencies {
      ...
      classpath 'org.grails.plugins:database-migration:3.1.0'
   }
}

dependencies {
   ...
     implementation 'org.grails.plugins:database-migration:3.1.0'
}

Run:

./grailsw dbm-gorm-diff

Expected Behaviour

Grails 5.1.1 should work.

Actual Behaviour

Error:

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
2021-12-27 22:18:12.487 ERROR --- [           main] o.s.boot.SpringApplication               : Application run failed

groovy.lang.MissingPropertyException: No such property: instance for class: liquibase.servicelocator.ServiceLocator
        at groovy.lang.MetaClassImpl.invokeStaticMissingProperty(MetaClassImpl.java:1019)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1963)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1938)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3870)
        at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.getProperty(ClassMetaClassGetPropertySite.java:50)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:329)
        at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.configureLiquibase(DatabaseMigrationGrailsPlugin.groovy:96)
        at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.doWithSpring(DatabaseMigrationGrailsPlugin.groovy:49)
        at org.grails.plugins.DefaultGrailsPlugin.doWithRuntimeConfiguration(DefaultGrailsPlugin.java:539)
        at org.grails.plugins.AbstractGrailsPluginManager.doRuntimeConfiguration(AbstractGrailsPluginManager.java:166)
        at grails.boot.config.GrailsApplicationPostProcessor.postProcessBeanDefinitionRegistry(GrailsApplicationPostProcessor.groovy:171)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:142)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
        at grails.ui.command.GrailsApplicationContextCommandRunner.run(GrailsApplicationContextCommandRunner.groovy:55)
        at grails.ui.command.GrailsApplicationContextCommandRunner.main(GrailsApplicationContextCommandRunner.groovy:102)

> Task :dbmGormDiff FAILED

Environment Information

abcfy2 commented 2 years ago

Seems grails 5.1.1 depends on io.micronaut:micronaut-bom:3.2.3 which bump liquibase to 4.5.0, and breaks grails-database-migration.

Add implementation 'org.liquibase:liquibase-core:3.10.3' solved this issue.

puneetbehl commented 2 years ago

Please try using the plugin version 4.0.0-RC3

abcfy2 commented 2 years ago

Yes. 4.0.0-RC3 is also working. Waiting for the final release.