Skip to content

Upgrading to Hsqldb 2rc8, part 1, Maven Integration

by Jeff

At my current client engagement, we make full use of hsqldb both in our unit tests and for local development. It’s a great tool, and the changes made since the last release 4 long years ago will make it an even better tool.

My project has hundreds of tests making use of hsqldb, and getting the new version up and running is no small task. I’ve broken this post into two. The first will be the steps I took to get hsqldb integrated into our maven repository. The second will cover getting hsqldb up and running with our legion of tests.

The first important thing to know when upgrading hsqldb, is that the pre-compiled jar files were built with jdk6. This is probably going to be fine for many, but there are many others, such as myself, who would like to be on jdk6 but work at a client site still using jdk5. It sucks to be me, but oh well.

So the first step for me will be to compile the jars myself with jdk15.

To do this, it’s necessary to have 3 environment variables set, JAVA_HOME, ANT_HOME, and ANT_OPTS. Pretty standard. If you’re on windows, there is a setenv.cmd file in the distributed build directory that you can edit and execute in the cmd shell.

At present, the build.xml contains a small bug for users trying to build the jar with jdk15. The “store” target contains a list of depends attributes:

depends=”switchtojdk11,switchtojdk12,switchtojdk14,switchtojdk16″

To build with jdk15 this must be changed to:

depends=”switchtojdk11,switchtojdk12,switchtojdk14,switchtojdk15″

(I’ve added a bug for this on sf)

Next run the following ant tasks from the hsqldb/build directory:

ant hsqldb;
ant sqltool

This will build the jars to the hsqldb/lib directory.

Next step is to add the jars to my local maven repo.

mvn install:install-file -DgroupId=hsqldb -DartifactId=hsqldb -Dversion=2.0.0 -Dpackaging=jar -Dfile="/Documents and Settings/ujxh744/My Documents/Downloads/hsqldb-2.0.0-rc8/hsqldb/lib/hsqldb.jar"
mvn install:install-file -DgroupId=hsqldb -DartifactId=sqltool -Dversion=2.0.0 -Dpackaging=jar -Dfile="/Documents and Settings/ujxh744/My Documents/Downloads/hsqldb-2.0.0-rc8/hsqldb/lib/sqltool.jar"

and update our main pom.xml with the new version of hsqldb and with a new entry for the sqltool:

<dependency>
<groupId>hsqldb</group>
<artifactId>hsqldb</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>sqltool</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>

And that’s it. You should be off to the races. Next up I’ll write about some of the sql changes.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

6 Comments

  1. Erik Frost wrote:

    The artifact ID for sqltool should be sqltool. Command line for mvn install:install still shows hsqldb artifactId for sqltool.

    cheers,

    Erik

    Monday, February 22, 2010 at 12:51 pm | Permalink
  2. Jeff wrote:

    Yes you’re right. Good catch, I’ve made the correction. Thanks for commenting

    Tuesday, February 23, 2010 at 12:39 pm | Permalink
  3. Daniel Serodio wrote:

    Your blog messed up the lesser-then, greater-then and quotes

    Thursday, March 4, 2010 at 1:42 pm | Permalink
  4. Jeff wrote:

    Thanks for letting me know. The syntax highlighter plugin we’re using is encoding when it shouldn’t.

    Thursday, March 4, 2010 at 6:48 pm | Permalink
  5. limewire wrote:

    shoot sweet story bro.

    Friday, April 30, 2010 at 9:42 am | Permalink
  6. Bruce wrote:

    Your blog messed up the lesser-then, greater-then and quotes

    Wednesday, May 19, 2010 at 2:40 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*