This project demonstrates how to run Liquibase from a Java application using a PostgreSQL database. It supports Java 8 and above and can be executed either with Maven or as a standalone Java application.
- Supports any Java version β₯ 8
- PostgreSQL integration via JDBC
- XML-based Liquibase changelogs
- Configurable changelog and target schema
- Maven and non-Maven execution options
- Uses a PostgreSQL database connection.
- Change log schema and target schema are configurable in the
Main.javafile. - Supports easy migration to MySQL or other databases by replacing the PostgreSQL JDBC dependency in
pom.xml. - Java-based Liquibase runner with XML changelogs
- Archiving table data through controlled change sets
- Versioned database schema changes (tables, constraints, indexes)
- Maintain and deploy stored procedures/functions as part of database migrations
- Supports PostgreSQL (can be extended to MySQL or others)
-
Database Settings:
- Update the database connection properties in
src/main/resources/db.properties.
- Update the database connection properties in
-
Liquibase Schema:
- To store the
DATABASECHANGELOGtable in a schema other thanpublic, updateMain.javaaccordingly. - Ensure the schema exists in the database before running the application.
- To store the
-
Java Version (Maven Builds Only):
- If using Maven, ensure the correct Java version is set under the Maven Compiler Plugin in
pom.xml:<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties>
- This step is not required when running the application directly via
Main.java.
- If using Maven, ensure the correct Java version is set under the Maven Compiler Plugin in
In the root directory of the project, execute the following command:
mvn clean compile exec:javaΒ© 2025 Rhythm Pangotra. All rights reserved.
This project is not open source. No part of this codebase may be copied, modified, distributed, or used without the express written permission of the author.
For licensing inquiries, contact: rhythmpangotra.be@gmail.com