I currently have the following in my application.properties
:
liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml
The actual path to the file is src/main/resources/db/changelog/db.changelog-master.xml
.
The changelog is found by Liquibase and everything is working as I would expect.
I've moved the changelog and all of the project's JPA entities and repositories into a separate project so that they can be shared with other projects.
This second project is a Maven dependency of the first project. What path do I need to use in application.properties
of the first project to access the liquibase changelog 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'm getting:
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)
I'm an idiot. My local ~/.m2
repository had an old version of the jar
without the Liquibase changelog. A mvn clean install
fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With