liquibase / liquibase-gradle-plugin

A Gradle plugin for Liquibase
Other
197 stars 57 forks source link

Version 2.1.0 is not compatible with Spring's dependency management plugin #94

Closed dmoidl closed 2 years ago

dmoidl commented 2 years ago

Hi 👋

After we upgraded the Liquibase Gradle plugin to version 2.1.0, the update task started failing with

Execution failed for task ':update'.
> Liquibase-core was not found  not found in the liquibaseRuntime configuration!

even though nothing else in the build file changed (which means we very much still do have liquibase-core in the liquibaseRuntime configuration). However, as we also use the Spring dependency management plugin we have it configured like so:

liquibaseRuntime("org.liquibase:liquibase-core")

letting said plugin choose the right version for us.

After examining the the sources I found out this is the root cause the issue: this check always fails in our case as we simply don't have an explicit version stated in the dependency notation.

A workaround is to add the explicit version, but that goes against the spirit of the dependency management plugin (and possibly any other kind of custom dependency management scheme).

stevesaliman commented 2 years ago

the problem seems to be with line 186: classpath.allDependencies appears to only tell me the version that was declared, not the version that will actually be used, which is ultimately what the plugin needs to know to choose the correct class to use for processing arguments.

The gradlew dependencies command shows the correct version, so I'll need to figure out how to get my plugin task to get that same information.

stevesaliman commented 2 years ago

Release 2.1.1 should fix this issue.

esselesse commented 7 months ago

@stevesaliman what about 2.2.1?

image