Spring boot Liquibase 4.0无法在jar中启动

Spring boot Liquibase 4.0无法在jar中启动,spring-boot,jar,liquibase,java-11,Spring Boot,Jar,Liquibase,Java 11,我使用Spring 2.3.3和Liquibase 4.0.0。 运行gradlew bootRun时效果很好,但当我运行编译的jar时,会收到大量消息,如: 2020-09-11 17:40:33.267 WARN 1 --- [ main] liquibase.integration : Cannot create filesystem for url jar:file:/app.jar!/BOOT-INF/lib/spri

我使用Spring 2.3.3和Liquibase 4.0.0。 运行gradlew bootRun时效果很好,但当我运行编译的jar时,会收到大量消息,如:

    2020-09-11 17:40:33.267  WARN 1 --- [           main] liquibase.integration                    : Cannot create filesystem for url jar:file:/app.jar!/BOOT-INF/lib/spring-aspects-5.2.8.RELEASE.jar!/: null

java.nio.file.FileSystemNotFoundException: null

...

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfigurati
on.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml
Liqbase gradle配置和运行库:

configurations {
liquibaseRuntime.extendsFrom runtime

compileOnly {
    extendsFrom annotationProcessor
}

Properties liquibaseProps = new Properties()
liquibaseProps.load(new FileInputStream("src/main/resources/liquibase.properties"))

Properties applicationProps = new Properties()
applicationProps.load(new FileInputStream("src/main/resources/application.properties"))

liquibase {

    activities {

        main {
            referenceUrl 'hibernate:spring:' + liquibaseProps.getProperty('liquibase.domain.package') + '?dialect=' + applicationProps.getProperty('spring.jpa.database-platform') + '&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy'
            driver applicationProps.getProperty('spring.datasource.driver-class-name')
            changeLogFile liquibaseProps.getProperty('liquibase.changelog.path') + migrationName() + '.yaml'
            url applicationProps.getProperty('spring.datasource.url')
            username applicationProps.getProperty('spring.datasource.username')
            password applicationProps.getProperty('spring.datasource.password')
        }
    }
}
}
运行时:

liquibaseRuntime 'org.liquibase:liquibase-core:4.0.0'
liquibaseRuntime 'org.liquibase:liquibase-groovy-dsl:2.1.2'
liquibaseRuntime 'org.postgresql:postgresql'

liquibaseRuntime 'org.liquibase.ext:liquibase-hibernate5:4.0.0'
liquibaseRuntime sourceSets.main.output

liquibaseRuntime "ch.qos.logback:logback-core"
liquibaseRuntime "ch.qos.logback:logback-classic"
liquibaseRuntime 'org.yaml:snakeyaml'
liquibaseRuntime group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'

liquibaseRuntime 'org.springframework.boot:spring-boot-starter-data-jpa'
liquibaseRuntime 'org.springframework.boot:spring-boot-starter-security'
liquibaseRuntime 'org.springframework.boot:spring-boot-starter-web'
液化。属性:

liquibase.changelog.path="classpath:src/main/resources/db/changelog/changes/"
liquibase.domain.package=ru.example.entities
应用程序配置 应用程序属性

spring.application.name = "Example"
application.description = "Example"
application.version = 1.0


spring.jpa.database-platform = org.hibernate.dialect.PostgreSQL10Dialect
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.hibernate.naming.implicit-strategy = org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql:localhost:5432/test
spring.datasource.username=postgres
spring.datasource.password=qwerty
我怎样才能修好它

更新:

liquibase.changelog.path="classpath:src/main/resources/db/changelog/changes/"
liquibase.domain.package=ru.example.entities
更新的资源/db/changelog/db.changelog-master.yaml:

在gradle中更新了liquibase配置:

    liquibase {
        activities {
            main {
                classpath "$projectDir/src/main/resources/db/changelog"
...
添加到application.properties: spring.liquibase.change log=classpath:db/changelog/db.changelog-master.yaml

现在我仍然收到一条关于找不到jar依赖项的警告:

liquibase.integration                    : Cannot create filesystem for url jar:file:/app.jar!/BOOT-INF/lib/spring-aspects-5.2.8.RELEASE.jar!/: null

java.nio.file.FileSystemNotFoundException: null
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:172) ~[jdk.zipfs:na]
但仍未找到嵌入的变更集:

 Could not find directory or directory was empty for includeAll 'db/changelog/changes/'
如果将includeAll修复替换为显式声明,则会出现问题:

databaseChangeLog:
  - include:
      file: changes/20200829022849_default.yaml
      relativeToChangelogFile: true
更新2 这里有一个关于存储库的链接 我构建并启动应用程序,如下所示:

./gradleew bootJar
java -jar example-0.0.1-SNAPSHOT.jar

从您的配置来看,liquibase似乎正在更改为默认值,即
类路径:/db/changelog/db.changelog master.yaml

因此,请添加到您的
应用程序中。属性
属性:

spring.liquibase.change log=classpath:db/changelog/changes/
-注意在此处添加文件名,以便它可以选择主变更日志。

这是一个提交的liquibase 4.0.0问题
Liuquibase3.10.2工作正常。

在春季提供您的liquibase配置。@bilak确定,已添加。显示应用程序中的内容。属性请添加应用程序和liquibase属性。与liquibase.properties中的liquibase.changelog.path不一样吗?选中的。Stll警告,如“liquibase.integration:无法为url jar创建文件系统:file:/app.jar!/BOOT-INF/lib/spring-aspects-5.2.8.RELEASE.jar!/:null java.nio.file.FileSystemNotFoundException:null”,我检查了/lib中是否存在这些jar。是的。它是否可能与docker或windows主机连接?我们将尝试在github上提供示例,以便我们可以帮助您。但如果存在异常
null java.nio.file.FileSystemNotFoundException:null
您可能配置了错误。添加到描述中。