Integrate Liquibase via maven
planning
• 1) Create project maven
• 2)Configuration POM
• 3)Demo database migration
2) Configuration POM.XML
• <dependency>
• <groupId>org.liquibase</groupId>
• <artifactId>liquibase-core</artifactId>
• <version>3.5.3</version>
• </dependency>
• <dependency>
• <groupId>mysql</groupId>
• <artifactId>mysql-connector-java</artifactId>
• <version>5.1.38</version>
• </dependency>
• <build>
• <plugins>
• <plugin>
• <groupId>org.liquibase</groupId>
• <artifactId>liquibase-maven-plugin</artifactId>
• <version>3.5.3</version>
<configuration>
<changeLogFile>D:/EJB/base_database/src/resources/liquibase/changelog/db.changelog-1.0.xml</changeLogFile>
<url>jdbc:mysql://localhost:3306/test3</url>
<username>root</username>
<password></password>
</configuration>
<executions>
<execution>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Configuration
3) Db-changelog.XML
• <?xml version="1.0" encoding="UTF-8"?>
• <databaseChangeLog
• xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
• xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
• xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
• xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
• http://www.liquibase.org/xml/ns/dbchangelog-ext
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
• </databaseChangeLog>
Changeset
• <changeSet author="turki" id="1">
• <createTable tableName="department">
• <column name="id" type="int">
• <constraints primaryKey="true" nullable="false"/>
• </column>
• <column name="name" type="varchar(50)">
• <constraints nullable="false"/>
• </column>
• <column name="active" type="boolean" defaultValueBoolean="true"/>
• </createTable>
• </changeSet>
Thank you for watching 
Don’t forget to subscribe

Liquibase via maven