当我运行mvn liquibase:update
,我得到这些在标准输出:mvn liquibase:更新结果“无法解析属性文件”。
[INFO] Executing on Database: jdbc:postgresql://localhost:5432/PROJECT_NAME
INFO 20/09/16 09:41:liquibase: null: null: Successfully acquired change log lock
INFO 20/09/16 09:41:liquibase: null: null: Creating database history table with name: databasechangelog
INFO 20/09/16 09:41:liquibase: null: null: Reading from databasechangelog
INFO 20/09/16 09:41:liquibase: null: null: Reading from databasechangelog
INFO 20/09/16 09:41:liquibase: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-master.yaml: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-1.0.yaml::1::matheus.serpellone: Table PERMISSIONS created
INFO 20/09/16 09:41:liquibase: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-master.yaml: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-1.0.yaml::1::matheus.serpellone: ChangeSet PROJECT_NAME/src/main/resources/db/changelog/db.changelog-1.0.yaml::1::matheus.serpellone ran successfully in 22ms
INFO 20/09/16 09:41:liquibase: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-master.yaml: null: Successfully released change log lock
这说明我已经找到了我的属性文件并成功运行它(更新数据库以及)。
然而,命令就会失败,因此:(。而且,这是Java中,帮助1没有帮助所有,它说这是一个MojoFailureException,当然)
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.0.5:update (default-cli) on project PROJECT_NAME: Failed to resolve the properties file. -> [Help 1]
我的POM有这个作为一个依赖:
<!-- Liquid Base -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.5.1</version>
</dependency>
而这正是我配置插件:
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.0.5</version>
<configuration>
<propertyFile>PROJECT_NAME/src/main/resources/db/changelog/liquibase.yaml</propertyFile>
</configuration>
</plugin>
</plugins>
</build>
在我liquibase.yaml文件:
driver: org.postgresql.Driver
classpath: ./lib/postgresql-9.2-1002-jdbc4.jar
url: jdbc:postgresql://localhost:5432/ifood_extranet_bff
username: xxx
password: xxx
changeLogFile: PATH_NAME/src/main/resources/db/changelog/db.changelog-master.yaml
在db.changelog-master.yaml:
databaseChangeLog:
- include:
file: extranet-bff-core/src/main/resources/db/changelog/db.changelog-1.0.yaml
而且db.changelog-1.0.yaml: --- databaseChangeLog : - changeSet: id:1 作者:matheus.serpellone 更改: - createTable: tableNam E:PERMISSIONS 列: - 柱: 名:ID 类型:BIGINT 自动增量:真 约束: 的PrimaryKey:真 可为空的:假 - 柱: 名:ROLE 类型:VARCHAR(255) 约束: 可空:假 - 列: 名:权限 类型:VARCHAR(255) 约束: 可空:假 ...
那么...什么可能会给“无法解析属性文件?”