Building JWebUnit

In order to build JWebUnit, you need to have Maven installed. This should not be any more difficult than installing ant. We've included a best practice installation and configuration for Maven.

Installing Sun JDK 1.6

JWebUnit is compiled with JDK 1.6 to ensure compatibility.

You need to download and install latest Sun JDK 1.6 for your platform. Let's say the JDK location is:

/opt/jdk1.6.0_22

Installing Maven

First you need to download the latest Maven, which currently is Maven-3.2.1 , make sure you download the binary archive (e.g. apache-maven-3.2.1-bin.tar.bz2).

Installing Maven should be easy: extract the file to any directory you like, let's say:

/opt/apache-maven-3.2.1

Next you need to do 2 things:

  • add an environment variable M2_HOME which points to the install directory of Maven, i.e. /opt/apache-maven-3.2.1
  • add $M2_HOME/bin (Linux) or %M2_HOME%\bin (Windows) to your path (using the variable you can switch more easily when a new version arrives)

You can test that Maven is correctly installed by running in a shell: mvn -v

Using Maven

Maven defines several goals, for creating and building your application. A goal is similar to an Ant-task. For instance: to compile the java sources one could do:

mvn compile
Also, a goal can depend on other goals: the package goal depends on running the unit tests and compilation of the code.

See the Maven site for more information on the different goals and plugins that are available.

Building JWebUnit

Building JWebUnit merely consist of running Maven:

mvn install

You now have successfully built JWebUnit. The files are in your private repository. To remove all traces of generated files, allowing your repository to install from scratch, use:

mvn clean

Testing JWebUnit

JWebUnit is supported with a suite of test cases, which ensure that the testing framework works as expected. These tests are run through Maven by running:

mvn test

Using Eclipse

If you are using the Eclipse IDE to develop the JWebUnit plugin, you can use m2eclipse.

Building Sourceforge upload bundle

For those who don't want to use Maven, we have to provide a zip with all required files.

mvn package assembly:assembly

The files are in target directory.

Building JWebUnit Web site and reports

Due to findbugs memory usage, following parameter is required:

export MAVEN_OPTS=-Xmx384M
Now you should be able to generate site:
mvn site

The files are in target/site directory of each module.
If you want to test the final assembled site, just hit:

mvn site:stage -DstagingDirectory=C:\fullsite

You can of course customize the destination folder of the assembled site.