Webtest WebTest GitHub Home

Building WebTest

This page describes how to build webtest from the sources. The build file included with the source provides a complete and repeatable build process, which the second section explains. The build file is used by the build server to produces high quality deliveries but can, and should, also be used to develop WebTest. It is however convenient during development to build webtest from the comfort of an IDE, and the third section gives a few hints on ow to set-up an IDE.

Prerequisites

A platform that is able to run Java.
An installed JDK version 8 or higher.
Ant, version 1.10.1 or newer.
The distributions of webtest contain the necessary part from ant 1.10.1 ready to run.

Building WebTest with ant

Rebuilding the whole Canoo WebTest from the source may be an option if you want to change it's behavior.

First, checkout the latest version from the svn repository to <WEBTEST_HOME> :

git clone git@github.com:DaveParillo/webtest.git
or
git clone https://github.com/DaveParillo/webtest.git

Then call the build script. Depending from your operating system, it may be necessary to fiddle with the execution rights of the scripts in the directory bin/ .

The main build file in <WEBTEST_HOME> provides the following targets:

clean
Deletes (most of) the results of a previous build.
develop
Compiles and tests webtest.
full
Runs clean, then compiles and tests webtest, then generates all kinds of documentations and reports.
fetchDependencies
Lets maven fetch all the dependencies described in the pom. This target needs only to be called explicitly if the build will occur offline.

To generate a complete release, including the documentation, type:

cd <WEBTEST_HOME>
bin/webtest.sh full

To get a clean build without documentation, type:

cd <WEBTEST_HOME>
bin/webtest clean develop

Building with an IDE

As there are too many possible IDEs, this section only outlines how to set-up an IDE.

Although webtest build is an ant script, it is taking advantage of Maven 's (version 2) declarative definition of dependencies: All dependencies required to build and run webtest are defined in the file pom.xml . The target fetchDependencies of the build script looks at the required dependencies, looks at maven's dependency cache (in the user's home directory) and downloads the dependency jar files from one of the maven repositories to the shared dependency cache.

Since the actual dependency jar files are not part of the module, but potentially shared with other unrelated projects, the difficulty is to tell the IDE which jar files it needs and where they are. The easiest solution is to take advantage of maven's various plugins to convert webtest's pom.xml to a project file for an IDE. This requires of course maven (version 2!) to be available on the machine.

Note that some dependencies are indeed part of webtest's module: these are jar files for versions that are not (yet?) available on a public maven repository. These jar files are however organized as a local maven repository and accessed like every other dependencies.

IntelliJ IDEA

To create an Idea project, just use:

cd <WEBTEST_HOME>
mvn idea:idea

Eclipse

To create an eclipse project, just use:

cd <WEBTEST_HOME>
mvn eclipse:eclipse

Note that working with the generated project-files in eclipse requires to define a new classpath variable named M2_REPO which leads to your local maven repository. It must be defined under preferences -> java -> build path .