JDK

JiBX/WS is built to run on JDK1.3.1 or later.

Coding Style

JiBX source code follows "normal" Java coding style, with the following exceptions:

  • Static fields, except for static final constants, start with s_
  • Non-static fields start with m_
  • Line length is 120 characters
  • Tabs are replaced with spaces. Java source code is indented by 4 spaces, XML elements are indented by 2 spaces.

Building JiBX/WS

JiBX/WS uses Ivy to manage its dependencies. The dependencies are listed in build/ivy.xml. To download the libraries run the "ant retrieve" target. This will download the ivy jar file if necessary, and download all the dependencies to the appropriate folders.

Publishing JiBX/WS

Three options for publishing the jibxws-jar file are included in the build file:

Ant targetDescription
publish-ivy-localPublishes to the local Ivy repository on the local machine. May be useful if you want to test the jar file with other Ivy enabled projects locally.
publish-maven-snapshotPublishes to the JiBX Maven snapshot repository. Stable builds from the Continuous Integration server should be published here.
publish-maven-releasePublishes to the JiBX Maven repository, which is replicated to the central Maven repository. Only release builds are to be published here.

The Maven publishing tasks use the Maven Ant plugin, which is automatically downloaded as required. To publish to the Maven repository, you must have an account for the Sourceforge jibx group. It is useful to have an SSH key setup, though I'm not sure this is necessary. You will also need to create, or modify, your ~/.m2/settings.xml file to contain the following:

<settings>
  <servers>
    <server>
      <id>sourceforge.net</id>
      <username>{your_sf_name},jibx</username>
      <password>{your_sf_pass}</password>
      <filePermissions>775</filePermissions>
      <directoryPermissions>775</directoryPermissions>
    </server>
  </servers>
</settings>
where {your_sf_name} is your Sourceforge username and {your_sf_pass} is your Sourceforge password. Make sure you secure this file, eg chmod 600.

Unit Tests

To run the unit tests, execute the ant "test" target in build/build.xml. Note that some of the unit tests currently fail when using JDK 1.5, due to this bug. There is a fix in the latest XmlUnit code, due to be released in XmlUnit 1.2. The options to make these tests run are:

  1. Use a JDK other than 1.5.0, or
  2. Download and build the latest xmlunit source

If running the tests from within an IDE, ensure that the JiBX binding compiler has been run on the compiled classes. The tests do include some static initialization to run the binding compiler - however the classes may already have been loaded before this kicks in. If so, the tests should work the 2nd time when invoked from the IDE.