Comments (4)
I'll keep an eye out for the next release to see if CORE-3343 gets resolved.
In the meantime, if the issue is truly fixed in the master branch, there are a couple of workarounds you could try...
Option 1:
-
If you're the only one building your project, you can simply clone the master branch and run
mvn -DskipTests install
to install the latest Liquibase to your local maven "repository" -
Add
mavenLocal()
to your build.gradle in all the places that currently havemavenCentral()
, making sure that mavenLocal comes before mavenCentral() -
Change the
liquibaseRuntime
Liquibase dependency to whatever version is in the Liquibase pom.xml.
Option 2:
If more than one person is building your project, you'll need to do the same things as option 1, but with an extra step to upload your version of Liquibase to a shared repository. That repository would then need to be added to build.gradle, but instead of mavenLocal()
, you'd have maven { url "http://myhost.mycompany.com/repo" }
from liquibase-gradle-plugin.
I am building it alone, so option 1 it is. Your suggested solution appears to have work, the URI exception is now gone. It still doesn't work ,though:
Unexpected error running Liquibase: java.lang.NullPointerException
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.NullPointerException
at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:200)
at liquibase.integration.commandline.Main.doMigration(Main.java:1004)
at liquibase.integration.commandline.Main.lambda$run$0(Main.java:187)
at liquibase.Scope.child(Scope.java:125)
at liquibase.Scope.child(Scope.java:106)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:142)
at liquibase.integration.commandline.Main.run(Main.java:186)
at liquibase.integration.commandline.Main.main(Main.java:125)
Caused by: liquibase.command.CommandExecutionException: java.lang.NullPointerException
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:198)
... 8 common frames omitted
Caused by: java.lang.NullPointerException: null
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.getDatabaseCatalogNames(JdbcSnapshotGenerator.java:147)
at liquibase.snapshot.jvm.CatalogSnapshotGenerator.snapshotObject(CatalogSnapshotGenerator.java:34)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:286)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:96)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:59)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:38)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:215)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:188)
at liquibase.command.core.DiffCommand.createReferenceSnapshot(DiffCommand.java:221)
at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:143)
at liquibase.command.core.DiffCommand.run(DiffCommand.java:135)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)
... 9 common frames omitted
This is caused by some weird class, which I do not understand the purpose of. It just returns null/0/false for everything. So then I tried removing
referenceDriver 'liquibase.ext.hibernate.database.connection.HibernateDriver'
and replaced the line with:
driver 'org.postgresql.Driver'
But that amounted to getting a new exception instead:
Unexpected error running Liquibase: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:131)
at liquibase.integration.commandline.Main.createReferenceDatabaseFromCommandParams(Main.java:1407)
at liquibase.integration.commandline.Main.doMigration(Main.java:1005)
at liquibase.integration.commandline.Main.lambda$run$0(Main.java:187)
at liquibase.Scope.child(Scope.java:125)
at liquibase.Scope.child(Scope.java:106)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:142)
at liquibase.integration.commandline.Main.run(Main.java:186)
at liquibase.integration.commandline.Main.main(Main.java:125)
Caused by: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:247)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:142)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:96)
... 9 common frames omitted
Caused by: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:193)
... 11 common frames omitted
No idea what that means since postgre driver is clearly listed as a liquibaseRuntime dependency, and I have seen other liquibase configurations that looked just like mine and worked.
Anyway, this is just me ranting, your suggestion was helpful. The follow up problems are not related to this issue, or the plugin in general.
from liquibase-gradle-plugin.
The issue got resolved in Liquibase 3.6.3. You can find a working example in my repo. You just have to use the following:
liquibaseRuntime 'org.liquibase:liquibase-core:3.6.3'
from liquibase-gradle-plugin.
@Kr0oked very cool. it works now.
from liquibase-gradle-plugin.
Related Issues (20)
- Problem with labelFilter argument HOT 1
- Avoiding duplication of properties between spring boot and gradle HOT 1
- With Gradle 7.6.2 and Java 17, Liquibase build throwing 'org.liquibase.gradle.LiquibaseTask' property 'command' is missing an input or output annotation HOT 3
- Is this project still active? HOT 2
- Is there a simple way to disable the plugin? HOT 2
- liquibase-gradle-plugin should declare picocli as a transitive dependency HOT 9
- Generate Changelog with defaultSchemaName not possible HOT 1
- Running Liquibase 4 with Gradle 8 causes error could not find method getMain() for arguments [] HOT 2
- spring boot v3 integration example HOT 5
- micronaut 4 liquibase plugin integration
- Liquibase --username argument should be placed after the command
- Task "updateSQL" ignores "--outputFile" parameter HOT 3
- Upgrade to "org.apache.groovy:groovy" HOT 1
- Java 19
- Liquibase "diffChangelog" suddenly stops generating migration files HOT 2
- markNextChangesetRan not filtering by label HOT 1
- Snakeyaml error when running diffChangelog
- Modify Liquibase Gradle Plugin to handle custom Liquibase extensions HOT 4
- Crashes with 2 errors when configuration cache is enabled
- How disable changelog xml file validation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquibase-gradle-plugin.