【发布时间】:2020-06-21 04:05:46
【问题描述】:
我是 Liquibase 的新手,我尝试将 liquibase 与 postgres 数据库一起使用,以使用 liquibase 脚本创建数据库表。我所做的是,我已经手动创建了 Postgres 表并通过运行命令
mvn liquibase:generateChangeLog
我创建了 liquibase-outputChangeLog.xml 文件。现在我尝试更新该脚本并在数据库中再创建一个表。为此,我在我的 changeLog.xml 文件中为该新表编写 XML 代码并尝试执行命令
mvn liquibase:update
但它给了我以下错误
必须指定 ChangeLogFile。
下面是我的 POM.xml 文件。
<dependency>
<groupId>tech.sample</groupId>
<artifactId>common-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>tech.sample</groupId>
<artifactId>common-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.8.7</version>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.8.7</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<!--Sonar Plugins-->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
</configuration>
<executions>
<execution>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
谁能帮帮我,这里有什么问题。
【问题讨论】:
-
请edit您的问题(点击下方的edit链接)并向我们展示您的
pom.xml和完成命令如何调用 Liquibase。 Formatted text 请no screen shots - edit 您的问题,请不要在 cmets 中发布代码
标签: java spring postgresql spring-boot liquibase