April 18, 2024, 4:04 p.m. | Salad Lam

DEV Community dev.to




Setup

Content of database/liquibase.properties



driver: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/databasename
username: root
password: password


Add following into Maven's pom.xml file



<build>
<plugins>
<!-- other plugins ... -->
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>4.27.0</version>
<configuration>
<propertyFile>${project.basedir}/database/liquibase.properties</propertyFile>
<!-- must use relative path because this will save into `databasechangelog` table
rollback will fail if `FILENAME` not match -->
<changeLogFile>database/changelog.xml</changeLogFile>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<!-- other sections ... -->


And put the database change file changelog.xml into database directory of project …

apache build changelog database driver file java jdbc localhost managed match maven mysql password path plugin plugins project save setup table url will xml

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US

Research Engineer

@ Allora Labs | Remote

Ecosystem Manager

@ Allora Labs | Remote

Founding AI Engineer, Agents

@ Occam AI | New York