简体   繁体   中英

How do I run a Liquibase changeLogFile from my classpath

I have a Spring Boot application that is configured to run Liquibase. I'm trying to set up a separate project that will be used as the database management project. It will store all of liquibase.properties files for different databases.

My database management project depends on my main app because it needs to load the chaneglogFile. However, my database management project cannot find the changelogFile on the classpath.

Here is the folder structure of the main project. The changelog is in src/main/resources so maven automatically adds it to the classpath

在此处输入图片说明

Here is the configuration in the liquibase.properties

changeLogFile=classpath:db/changelog/db.changelog-master.yaml

As well as the maven plugin configuration

    <build>
        <plugins>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>3.8.2</version>
                <configuration>
                    <propertyFile>liquibase.properties</propertyFile>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.my-group</groupId>
                        <artifactId>my-app</artifactId>
                        <version>1.0.0-SNAPSHOT</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

And the resulting error

Failed to execute goal org.liquibase:liquibase-maven-plugin:3.8.2:status (default-cli) on project my-app-db: Error setting up or running Liquibase: classpath:db/changelog/db.changelog-master.yaml does not exist

what about trying

changeLogFile=src/main/resources/db/changelog/db.changelog-master.yaml

does that work for you?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM