Using snapshots

If you want to stay recent but don't want to build yourself, you can use the snapshots generated by our bamboo server, which are available at http://wicketstuff.org/maven/repository/.

Table of contents

Building Wicket from Source

We use Maven 2 as our build system.

How to build Wicket 1.4

(Based on http://wicket.apache.org/building-from-svn.html.)

Before you start

Ensure that you're building with JDK1.5. (As I understand it, JDK 1.6 will build correctly but some of the tests fail as the test results verification doesn't allow for changes in Collection orderings.)

The build

  • Checkout either the trunk or a tagged 1.4 release.
  • If you checked out from the trunk and if you want to fix your snapshot, now is the time to add a date to the version in the file pom.xml in the top level folder. Find the fragment <version>1.4-SNAPSHOT</version> and replace SNAPSHOT with the current date. For example: <version>1.4-20070504</version>.
  • Execute mvn install in the top level folder. If this fails because of test failures, execute mvn -Dmaven.test.skip=true install.

Usage

For further instructions see the section "Using your own built artifacts" on http://wicket.apache.org/building-from-svn.html.

How to build Wicket 1.3

(Based on http://wicket.apache.org/building-from-svn.html.)

Before you start

If you want to ensure that your Wicket version is built using JDK-1.4 and fully compatible with that Java version, you will need to build it with a Java 1.4 compiler and runtime library. Maven is set up so that it will only build the JDK-1.4 projects when it is started using a 1.4 Java version. Note that to build the full set of examples and annotations will require a Java 1.5 compiler.

The build

  • Checkout either the 1.3 branch or a tagged 1.3 release.
  • If you checked out from the branch and if you want to fix your snapshot, now is the time to add a date to the version in the file pom.xml in the top level folder. Find the fragment <version>1.3.4-SNAPSHOT</version> and replace SNAPSHOT with the current date. For example: <version>1.3.4-20070504</version>.
  • Execute mvn install in the top level folder. If this fails because of test failures, execute mvn -Dmaven.test.skip=true install.

Usage

For further instructions see the section "Using your own built artifacts" on http://wicket.apache.org/building-from-svn.html.

How to build Wicket 1.2

  • Checkout Branch 1.2.x or any other branch or tag. (Browse to the Wicket repository to find your branch/tag.)
  • Go to the wicket-parent subdirectory and issue mvn install, this will compile and install all Wicket modules
  • Take the time to hack one of the modules (let's say wicket)
  • Issue mvn install in that module to recompile, you will have the freshly built JAR in the "target" directory
  • If failing unit tests are bothering you, use the following maven commandline option: mvn -Dmaven.test.skip=true install

Complete instructions can be found at wicket-parent/README.TXT in branch 1.2.x

How to build with Maven 1 (up to Wicket 1.1)

Here's a list of commands used often for building wicket:

  • maven site - runs unittests and creates the documentation site in <tt>build/docs''
  • maven xdoc - transforms the project.xml and the documentation in xdocs into a site. Does not run unittests, or create javadoc: use maven site for that.
  • maven test - runs the unit tests from the commandline (if tests fail, see the results in build/test-reports)
  • maven jar:install-snapshot - installs a SNAPSHOT version into your local repository for usage in other projects (make your project dependend on wicket-SNAPSHOT.jar).
  • maven jar:install - The same as previous command but it creates{{wicket-VERSION.jar}} and copy to local maven repository.
  • maven console - keeps maven in memory, allowing faster xdoc transformations, handy for editing documentation in xdocs.

Misc notes

Missing Libraries

Occasionally, especially when building the examples from SVN, you will find that several libraries are not available from public sites like Ibiblio or one of its mirrors.

The fact that those libraries are not available for download by maven, comes from either two issues:

  • licensing, not all libraries are available for free (as in speech), or have some other restriction on library distribution (JDBC drivers, Java mail API, etc.)
  • awareness of projects, not all (open source) projects are aware that people want to download their libraries using maven

Either way, you need a way to get to those files. For both types of dependencies, there is only one solution:

YOU NEED TO DOWNLOAD THEM YOURSELF

After that, find the jar-file in the distribution that you need, rename it to contain the version of the product, and copy it into your local repository. From then on, you can use the dependency in all your projects, including the wicket examples.

For maven 2 you install a downloaded file to your repository with the following:
mvn install:install-file -Dfile=<file.jar> -DgroupId=<groupid> -DartifactId=<artifact> -Dversion=<version> -Dpackaging=jar -DgeneratePom=true

Example: java mail api

The Java mail api is not freely distributable. You will have a hard time finding a project distributing the javamail.jar file publicly without written consent of uncle Sun.

  1. Download the API Sun, don't forget to read the license agreement. You will see why the library is not on Ibiblio (erhm... the library is there, but AFAIK this is not supposed to be).
  2. Unzip the file and rename the necessary jar files to include the appropiate version numbers (otherwise, why use maven?)
  3. copy the files to your local repository (usually located under your home directory, C:\Documents and Settings\username\.maven\repository in a directory using a clear name (javamail comes to mind) and put the jars into the jars subdirectory, mimicking the repository layout.

Maven Gotchas

  • Sometime you don't want to run tests each time you build Wicket. You could switch off tests by setting maven.test.skip property to true. Example: mvn -Dmaven.test.skip=true clean package
  • No labels

1 Comment

  1. If you wanted to compile, install, package bit quickly I have described it here in my http://ritesht.blogspot.com