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.
- A platform that is able to run Java.
- An installed JDK version 6 or higher.
- Ant, version 1.8.4 or newer.
- The distributions of webtest contain the necessary part from ant 1.8.4 ready to run.
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> :
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:
- Deletes (most of) the results of a previous build.
- Compiles and tests webtest.
- Compiles and tests webtest, then generates all kinds of documentations and reports.
This is the target used by the build server.
- 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:
To get a clean build without documentation, type:
bin/webtest clean develop
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.
To create an Idea project, just use:
To create an eclipse project, just use:
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 .