如何使用jar文件中的Liquibase更改日志

mip*_*mip 8 java spring liquibase maven spring-boot

我目前在我的手中有以下内容application.properties:

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

该文件的实际路径是src/main/resources/db/changelog/db.changelog-master.xml.

更改日志是由Liquibase发现的,一切都按照我的预期运作.

我已将更改日志和项目的所有JPA实体和存储库移动到一个单独的项目中,以便可以与其他项目共享.

第二个项目是第一个项目的Maven依赖项.我需要在application.properties第一个项目中使用哪条路径来访问第二个项目中的liquibase changelog?

更新

我有:

projectA.jar - > pom.xml

<dependency>
    <groupId>com.foo</groupId>
    <artifactId>projectB</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

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

但是我得到了:

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)
Run Code Online (Sandbox Code Playgroud)

mip*_*mip 6

我是个白痴。我的本地~/.m2存储库有一个jar没有 Liquibase 更改日志的旧版本。Amvn clean install解决了问题。