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/.
Building Wicket from Source
We use Maven as our build system. Maven manages our dependencies.
How to build with Maven 2 (starting from Wicket 1.3)
(Based on http://incubator.apache.org/wicket/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.
The build
- Checkout either trunk or a tagged 1.3 release.
- If you checked out from 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.3.0-incubating-SNAPSHOT</version>
and replaceSNAPSHOT
with the current date. For example:<version>1.3.0-incubating-20070504</version>
. - Execute
mvn install
in the top level folder. If this fails because of test failures, executemvn -Dmaven.test.skip=true install
.
Usage
For further instructions see the section "Using your own built artifacts" on http://incubator.apache.org/wicket/building-from-svn.html.
How to build with Maven 2 (starting from 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.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 theproject.xml
and the documentation inxdocs
into a site. Does not run unittests, or create javadoc: usemaven site
for that.maven test
- runs the unit tests from the commandline (if tests fail, see the results inbuild/test-reports
)maven jar:install-snapshot
- installs a SNAPSHOT version into your local repository for usage in other projects (make your project dependend onwicket-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.
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.
- 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).
- Unzip the file and rename the necessary jar files to include the appropiate version numbers (otherwise, why use maven?)
- 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 thejars
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:maven -Dmaven.test.skip=true clean jalopy jar:install
- Maven have a lot of plugins that comes to us in standart Maven bundle. To see list of available goals just type
maven -g
- Sometimes you don't want to allow Maven check *-SNAPSHOT dependencies from the remote repository. For example you have wicket-SNAPSHOT dependency builded by yorself and very poor internet channel. In this case -o switch helps you. Example
maven -o war:webapp