Some Liquibase-related componentry for your perusal

I threw together three little components that might help out Liquibase developers.

The first component is a general Maven utility class called Artifacts that currently has one method in it.  The method takes in a bunch of stuff but basically sorts a Maven project’s transitive set of dependencies from most autonomous to least.  You can see that here: https://github.com/ljnelson/maven-artifacts

Next up is a general-purpose Maven plugin called the artifact-maven-plugin.  Basically, it uses the class I just described to sort all the transitive dependencies of a project, then makes sure they’re resolved, and then hands the sorted list off to a user-supplied processor to do…well, whatever it wants.  You can see that here: https://github.com/ljnelson/artifact-maven-plugin

Last is a processor that creates a Liquibase changelog whose contents consist of statements.  The statements are jar: URLs referencing the local Maven repository copies of a project’s resolved artifacts.  You can see that here: https://github.com/ljnelson/maven-liquibase

When you put them all together properly, it means you can have jar files representing small chunky bits of an overall database schema that each contain only the Liquibase changelog fragments they need to describe only their tiny slice of the overall database world.  Then your Maven projects can then automatically stitch them together at unit or integration test time (using all these utilities) so that, for example, things like foreign key references across schema chunks continue to work.  Change your Maven dependencies?  Change the appropriate number of tables created, maintained, etc.

I’ll have more to say on this in a blog post at http://lairdnelson.wordpress.com in the near future.  I wanted to post this here because I’ve been a happy user of Liquibase for a long time and wanted to give something back.

Best,

Laird


http://about.me/lairdnelson

That is a good way to manage your changelog. Thanks for posting them and pointing them out. Let us know when you have your blog post added.

Nathan

I’ve got a quick start up while I work on a longer blog post.  Please see https://github.com/ljnelson/maven-liquibase/blob/master/README.md.

(This project provides classes for use by the extremely general-purpose artifact-maven-plugin project.)

Best,

Laird


http://about.me/lairdnelson