I am getting this exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 and java.lang.NoClassDefFoundError: Coul
If you are looking for similar solution as @godsim shared, but for gradle liquabase plugin, then modify your configuration section in build.gradle to exclude liquabase's groovy dependency:
configurations {
...
liquibaseRuntime.exclude group: "org.codehaus.groovy"
}
and then manually add groovy in dependencies section:
dependencies {
...
liquibaseRuntime('org.liquibase:liquibase-core:3.8.1')
liquibaseRuntime('org.codehaus.groovy:groovy-all:3.0.3')
liquibaseRuntime 'org.postgresql:postgresql'
liquibaseRuntime('org.liquibase:liquibase-groovy-dsl:2.1.2')
liquibaseRuntime('org.liquibase.ext:liquibase-hibernate5:3.10.2')
liquibaseRuntime('org.springframework.boot:spring-boot-starter-data-jpa')
liquibaseRuntime sourceSets.main.output
...
}