Fork me on GitHub



The plugin itself does not include the SQLJ Translator, but expects it to be available on the classpath during build time. For this to happen, an artifact containing the SQLJ Translator (the class) needs to be added as a dependency to the plugin or as a dependency to the project. Below is an example showing how to configure an SQLJ artifact as a dependency to the plugin:


The coordinates of the SQLJ artifact does not matter. The coordinates used above are only an example.

The plugin will use standard Maven artifact resolution to retrieve the artifact from configured Maven repositories. Typically the SQLJ artifact should be deployed to your internally hosted Maven repository, which will make it available for the entire development team. However, for quick evaluation purposes you could add it to your local repository instead. You would do the latter through the usage of the Maven Install Plugin:

mvn install:install-file \ \
    -DartifactId=sqlj \
    -Dversion=1.0 \
    -Dpackaging=jar \
    -Dfile=c:\progra~1\ibm\SQLLIB\java\ \

Note: Adding it to your local repository would only make the artifact available for that specific environment and is therefore normally not a good solution for development teams.

SQLJ Translation classpath

The classpath used during SQLJ Translation is as follows:

  1. the classpath of the plugin
  2. the classpath of the project (compile resolution scope)

Note: Java classes in the project will not be included as the plugin executes before they are compiled.

Translating SQLJ source code

To parse and translate SQLJ source code, configure the sqljDirs and/or sqljFiles element. Both can be used at the same time. Only files with .sqlj extension will be picked up from the sqljDirs element.