官术网_书友最值得收藏!

  • Practical DevOps
  • Joakim Verona
  • 122字
  • 2021-07-16 09:48:08

The pom.xml file

The pom.xml file, which is a standard Maven project model file, defines things such as the JDBC URL we need so that we can connect to the database we wish to work with as well as the version of the Liquibase plugin.

An H2 database file, /tmp/liquidhello.h2.db, will be created. H2 is a convenient in-memory database suitable for testing.

This is the pom.xml file for the "liquibase hello world" example:

<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>se.verona.liquibasehello</groupId>
  <artifactId>liquibasehello</artifactId>
  <version>1.0-SNAPSHOT</version>
  <build>
    <plugins>
      <plugin>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-maven-plugin</artifactId>
        <version>3.0.0-rc1</version>
        <configuration>
          <changeLogFile>src/main/resources/db-changelog.xml
          </changeLogFile>
          <driver>org.h2.Driver</driver>
          <url>jdbc:h2:liquidhello</url>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.171</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>

If you run the code and everything works correctly, the result will be an H2 database file. H2 has a simple web interface, where you can verify that the database structure is indeed what you expect.

主站蜘蛛池模板: 澎湖县| 楚雄市| 西峡县| 崇明县| 四子王旗| 汾阳市| 敦煌市| 马龙县| 潮州市| 鄂伦春自治旗| 通州区| 定边县| 分宜县| 合阳县| 大方县| 中宁县| 岳阳县| 信阳市| 延安市| 财经| 大英县| 中西区| 阜城县| 建平县| 蓬莱市| 汉源县| 松桃| 商水县| 凤台县| 黎平县| 丰镇市| 江西省| 岚皋县| 嘉鱼县| 原平市| 施秉县| 余庆县| 渑池县| 天峨县| 九龙县| 晋城|