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.
JWebUnit is compiled with JDK 1.5 to ensure compatibility.
You need to download and install latest Sun JDK 1.5 for your platform. Let's say the JDK location is:
First you need to download the latest Maven, which currently is Maven-3.0 , make sure you download the binary archive (e.g. apache-maven-3.0-bin.tar.bz2).
Installing Maven should be easy: extract the file to any directory you like, let's say:
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.0
- 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
You can run Maven with any JDK (let's say JDK 1.6) but JWebUnit should be compiled with JDK 1.5. To achieve this we are using Maven toolchains mecanism.
Create a file ~/.m2/toolchains.xml with the given content:
<?xml version="1.0" encoding="UTF8"?> <toolchains> <toolchain> <type>jdk</type> <provides> <version>1.5</version> <vendor>sun</vendor> <id>1.5</id> </provides> <configuration> <jdkHome>/opt/jdk1.5.0_22</jdkHome> </configuration> </toolchain> </toolchains>
You should of course define the correct jdkHome for you.
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:
See the Maven site for more information on the different goals and plugins that are available.
Building JWebUnit merely consist of running Maven:
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:
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:
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.
Due to findbugs memory usage, following parameter is required:
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.
If it is taking a long time to build the dependencies report of each plugin, you can disable it by adding the following parameter (reference):