Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

For more information on the project structure, please read the 'Better Builds With Maven'
book which has a detailed description on how to structure a maintainable, enterprise ready
build. The book is available for free from the Mergere website.

...

When you build from SVN you will need to should check out a the whole branch, because our project depend
of trunk or the selected branch as the project consists of various modules that may depend on one another. For Wicket the current (1.x 4) development branch, you will need to check out:

svn co httpshttp://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.xImage Removedtrunk

This will give you a directory structure like the following directory tree:

  • wicket-1.x
  • wicket-1.x/

...

  • wicket

...

  • wicket-1.x

...

  • /wicket-extensions
  • wicket-1.x/

...

  • wicket-spring

...

  • wicket-1.x

...

  • /wicket-auth-roles
  • wicket-1.x/

...

  • wicket-examples
  • wicket-1.x/

...

  • wicket-spring-annot
  • ...

In this document we focus at the maven project descriptor located in the top level directory,
which enforces default settings for all Wicket projects such as plug-in settings, versioning
of the Wicket projects, managing the various dependencies and more.

The artifacts in this project are there only for having a consistent build. This top-level project
doesn't have sources for itself.

Building Wicket 1.x

The build has two parts: a Java 1.4 part for the projects that are Java 1.4 based and
a Java 5 part, specific for the projects that are Java 5 based. The corresponding projects
reside (you guessed it!) in the jdk-1.4 and jdk-1.5 sub directoriescurrent development version of Wicket requires at least jdk 1.5.

svn co httpshttp://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.xImage Removedtrunk

If you want to ensure that your Wicket version is built using JDK-1.4 5 and fully compatible with that Java version,
you will need to build is it with a Java 1.4 5 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.

Building all of Wicket is as simple as issuing the following command in the root directory:

...

This will compile, test, package and install all Wicket projects. Installation means putting the jar files into your
local Maven repository, including the source and javadoc jars, but without the javadoc jars (this is a Wicket specific configuration, because build javadoc takes a long time).

The following commands are useful:

Commandline

Description

mvn clean

cleans up build artifacts

mvn compile

compiles the projects

mvn package

creates the jar files in the target/ subdirectories

mvn install

installs the jar files in your local repository

mvn -Prelease package

generates the javadoc/source jars as well

You can just run the install target, as Maven will build the previous stages automatically.

...

Code Block
mvn -Dmaven.test.skip=true install

Of course, all limits bets are off then and your mileage may vary if you use such a built jar.

...

Now you have built your own fresh Wicket jar you must be anxious to use it. This is now as simple as adding
a snapshot dependency on the specific Wicket version. So in your pom.xml you can use:

Code Block
xml
xml
<dependency>
    <groupId>org.apache.wicket</groupId>
    <artifactId>wicket</artifactId>
    <version>1.3.0-incubating4-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>

...

One thing you need to make sure is that you have set the M2_REPO classpath variable in
Eclipse (or a similar construct in Netbeans), and point it to your local repository, typically found in
C:\Documents and Settings\username\.m2\repo or (for unix buffs) ~/.m2/repo

...