Maven Liquibase Utilities


License

License

MIT
Categories

Categories

Maven Build Tools Liquibase Data Databases
GroupId

GroupId

com.edugility
ArtifactId

ArtifactId

maven-liquibase
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

Maven Liquibase Utilities
Maven Liquibase Utilities
Project Organization

Project Organization

Edugility
Source Code Management

Source Code Management

https://github.com/ljnelson/maven-liquibase/

Download maven-liquibase

How to add to project

<!-- https://jarcasting.com/artifacts/com.edugility/maven-liquibase/ -->
<dependency>
    <groupId>com.edugility</groupId>
    <artifactId>maven-liquibase</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.edugility/maven-liquibase/
implementation 'com.edugility:maven-liquibase:1.0.4'
// https://jarcasting.com/artifacts/com.edugility/maven-liquibase/
implementation ("com.edugility:maven-liquibase:1.0.4")
'com.edugility:maven-liquibase:jar:1.0.4'
<dependency org="com.edugility" name="maven-liquibase" rev="1.0.4">
  <artifact name="maven-liquibase" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.edugility', module='maven-liquibase', version='1.0.4')
)
libraryDependencies += "com.edugility" % "maven-liquibase" % "1.0.4"
[com.edugility/maven-liquibase "1.0.4"]

Dependencies

compile (3)

Group / Artifact Type Version
com.edugility : artifact-maven-plugin jar 1.0.5
org.liquibase : liquibase-core jar 3.4.1
org.mvel : mvel2 jar 2.2.7.Final

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Maven Liquibase Utilities

Utilities for where Maven and Liquibase intersect.

Quick Start

Suppose you have a JPA-oriented Maven project and you want to set up an in-memory database for integration testing. Suppose further your JPA project depends on other JPA-oriented projects. Suppose further that all such projects have a META-INF/liquibase/changelog.xml embedded within them that manages only their tables.

Add this to your build to have a changelog dynamically and automatically assembled for you at process-test-resources time:

<plugin>
  <groupId>com.edugility</groupId>
  <artifactId>artifact-maven-plugin</artifactId>
  <version>1.0.1</version>
  <dependencies>
    <dependency>
      <groupId>com.edugility</groupId>
      <artifactId>maven-liquibase</artifactId>
      <version>1.0.1</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <id>Generate aggregate Liquibase changelog for integration tests</id>
      <phase>process-test-resources</phase>
      <goals>
        <goal>process</goal>
      </goals>
      <configuration>
        <artifactsProcessor implementation="com.edugility.maven.liquibase.LiquibaseChangeLogArtifactsProcessor">
          <changeLogGenerator implementation="com.edugility.maven.liquibase.AggregateChangeLogGenerator">
            <aggregateChangeLogFile>${project.build.directory}/generated-sources/changelog.xml</aggregateChangeLogFile>
          </changeLogGenerator>
        </artifactsProcessor>
      </configuration>
    </execution>
  </executions>
</plugin>

Regarding configuration of all the pieces, make sure you fully understand how to configure Maven plugins, including how to specify complex objects. Then see the javadoc for the LiquibaseChangeLogArtifactsProcessor and the javadoc for the AggregateChangeLogGenerator.

Then, once you have this changelog.xml in place, you'll need to run it in your unit or integration tests. Currently that's an exercise left to the reader. To do this, you'll need a ResourceAccessor that can read URLs. For that, see the liquibase-extensions project.

See Also

Versions

Version
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0