How to use liquibase change log located in jar file

I currently have application.properties:

liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml

The actual file path is src/main/resources/db/changelog/db.changelog-master.xml.

The change log is found by Liquibase, and everything works as I expected.

I translated the change log and all the JPA objects of the project and the repository into a separate project so that they can share other projects.

This second project is a Maven dependency on the first project. Which way do I need to use in the application.propertiesfirst project to access the linibase change list in the second project?

Update

I have:

projectA.jar β†’ pom.xml

<dependency>
    <groupId>com.foo</groupId>
    <artifactId>projectB</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

projectA.jar β†’ application.properties

liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml

projectB.jar β†’ src / main / resources / db / changelog / db.changelog-master.xml

But I get:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot find changelog location: class path resource [db/changelog/db.changelog-master.xml] (please add changelog or check your Liquibase configuration)
+4
source share
1

. ~/.m2 jar Liquibase. A mvn clean install .

+2

Source: https://habr.com/ru/post/1589035/


All Articles