最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Liquibase with DocumentDB error: Driver class was not specified and could not be determined from the url - Stack Overflow

programmeradmin5浏览0评论

I'm trying to use Liquibase community edition and the liquibase-mongodb Maven extension to connect to DocumentDB v5.

After 2 weeks of work, I could not solve this error no matter what I tried:

liquibase.exception.DatabaseException: java.lang.RuntimeException: Driver class was not specified and could not be determined from the url ('mongodb://administrator:[MY_PASSWORD]@mongodb-cluster.cluster-xyz.eu-west-1.docdb.amazonaws:27017/admin?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')

pom.xml file:

changeLogFile: changelog-master.yaml
databaseClass: liquibase.ext.mongodb.database.MongoLiquibaseDatabase
url:           mongodb://administrator:[MY_PASSWORD]@mongodb-cluster.cluster-xyz.eu-west-1.docdb.amazonaws:27017/admin?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false

liquibase.properties file contains this maven imports (I tried different dependency versions):

   <dependency>
        <groupId>.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <version>4.31.1</version>
    </dependency>

    <dependency>
        <groupId>.liquibase.ext</groupId>
        <artifactId>liquibase-mongodb</artifactId>
        <version>4.31.1</version>
    </dependency>

    <dependency>
        <groupId>.mongodb</groupId>
        <artifactId>mongodb-driver-sync</artifactId>
        <version>5.2.1</version>
    </dependency>

    <dependency>
        <groupId>.mongodb</groupId>
        <artifactId>mongodb-driver-core</artifactId>
        <version>5.2.1</version>
    </dependency>

and

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>4.31.1</version>
            </plugin>
        </plugins>
    </pluginManagement>

Note that Liquibase does start up correctly:

Starting Liquibase at 09:01:20 using Java 17.0.5 (version 4.31.1 #6739 built at 2025-02-13 13:46+0000)

Any help would be appreciated!

I'm trying to use Liquibase community edition and the liquibase-mongodb Maven extension to connect to DocumentDB v5.

After 2 weeks of work, I could not solve this error no matter what I tried:

liquibase.exception.DatabaseException: java.lang.RuntimeException: Driver class was not specified and could not be determined from the url ('mongodb://administrator:[MY_PASSWORD]@mongodb-cluster.cluster-xyz.eu-west-1.docdb.amazonaws:27017/admin?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false')

pom.xml file:

changeLogFile: changelog-master.yaml
databaseClass: liquibase.ext.mongodb.database.MongoLiquibaseDatabase
url:           mongodb://administrator:[MY_PASSWORD]@mongodb-cluster.cluster-xyz.eu-west-1.docdb.amazonaws:27017/admin?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false

liquibase.properties file contains this maven imports (I tried different dependency versions):

   <dependency>
        <groupId>.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <version>4.31.1</version>
    </dependency>

    <dependency>
        <groupId>.liquibase.ext</groupId>
        <artifactId>liquibase-mongodb</artifactId>
        <version>4.31.1</version>
    </dependency>

    <dependency>
        <groupId>.mongodb</groupId>
        <artifactId>mongodb-driver-sync</artifactId>
        <version>5.2.1</version>
    </dependency>

    <dependency>
        <groupId>.mongodb</groupId>
        <artifactId>mongodb-driver-core</artifactId>
        <version>5.2.1</version>
    </dependency>

and

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>4.31.1</version>
            </plugin>
        </plugins>
    </pluginManagement>

Note that Liquibase does start up correctly:

Starting Liquibase at 09:01:20 using Java 17.0.5 (version 4.31.1 #6739 built at 2025-02-13 13:46+0000)

Any help would be appreciated!

Share Improve this question asked Mar 18 at 8:57 s.dragoss.dragos 6842 gold badges9 silver badges32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Moving mongodb dependency under the plugin section may fix it. Something like:

            <plugin>
                <groupId>.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>.liquibase.ext</groupId>
                        <artifactId>liquibase-mongodb</artifactId>
                        <version>${liquibase.version}</version>
                    </dependency>

                    <dependency>
                        <groupId>.mongodb</groupId>
                        <artifactId>mongodb-driver-sync</artifactId>
                        <version>5.2.1</version>
                    </dependency>

                    <dependency>
                        <groupId>.mongodb</groupId>
                        <artifactId>mongodb-driver-core</artifactId>
                        <version>5.2.1</version>
                    </dependency>
                </dependencies>
            </plugin>

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论