| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <title>Build from source | Apache Wicket</title> |
| <meta charset="utf8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| |
| <link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" /> |
| <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" /> |
| <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" /> |
| |
| <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> |
| |
| </head> |
| |
| <body class=""> |
| <div class="header default"> |
| <div class="l-container"> |
| <nav class="mainmenu"> |
| <ul> |
| <!-- /start/quickstart.html || /contribute/build.html --> |
| <li class=""><a href="/start/quickstart.html">Quick Start</a></li> |
| <!-- /start/download.html || /contribute/build.html --> |
| <li class=""><a href="/start/download.html">Download</a></li> |
| <!-- /learn || /contribute/build.html --> |
| <li class=""><a href="/learn">Documentation</a></li> |
| <!-- /help || /contribute/build.html --> |
| <li class=""><a href="/help">Support</a></li> |
| <!-- /contribute || /contribute/build.html --> |
| <li class=""><a href="/contribute">Contribute</a></li> |
| <!-- /apache || /contribute/build.html --> |
| <li class=""><a href="/apache">Apache</a></li> |
| </ul> |
| </nav> |
| <div class="logo"> |
| <a href="/"><img src="/img/logo-apachewicket-white.svg" alt="Apache Wicket"></a> |
| </div> |
| </div> |
| </div> |
| <main> |
| <div class="l-container"> |
| <header class="l-full preamble"> |
| <h1>Build from source</h1> |
| </header> |
| <section class="l-one-third right"> |
| <div id="toc" class="toc"><div id="toc-title"><h2>Table of Contents</h2></div><ul><li class="toc--level-1 toc--section-1"><a href="#getting-your-wicket-version"><span class="toc-number">1</span> <span class="toc-text">Getting your Wicket version</span></a></li><li class="toc--level-1 toc--section-2"><a href="#building-wicket"><span class="toc-number">2</span> <span class="toc-text">Building Wicket</span></a><ul><li class="toc--level-2 toc--section-3"><a href="#coping-with-test-failures"><span class="toc-number">2.1</span> <span class="toc-text">Coping with test failures</span></a></li><li class="toc--level-2 toc--section-4"><a href="#using-your-own-built-artifacts"><span class="toc-number">2.2</span> <span class="toc-text">Using your own built artifacts</span></a></li></ul></li></ul></div> |
| </section> |
| <section class="l-two-third left"> |
| <p>The Wicket projects are built using a multi-module build as proposed by the |
| Maven project. We use Maven to build our projects and distributions. To be |
| able to build Wicket directly from subversion, you will need an understanding |
| of Maven.</p> |
| <p>This document contains the following sections.</p> |
| <ol> |
| <li>Getting your Wicket version</li> |
| <li>Building Wicket</li> |
| <li>Coping with test failures</li> |
| <li>Using your own built artifacts</li> |
| </ol> |
| <p>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.</p> |
| <h2 id="getting-your-wicket-version">Getting your Wicket version</h2> |
| <p>Clone the master branch from Apache Git Wicket repository</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="gp">$</span> git clone http://git-wip-us.apache.org/repos/asf/wicket.git</code></pre></div> |
| <p>This will give you a directory structure like the following directory tree:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="go">wicket</span> |
| <span class="go">wicket/wicket-core</span> |
| <span class="go">wicket/wicket-extensions</span> |
| <span class="go">wicket/wicket-spring</span> |
| <span class="go">wicket/wicket-auth-roles</span> |
| <span class="go">wicket/wicket-examples</span> |
| <span class="go">wicket/wicket-spring-annot</span> |
| <span class="go">...</span></code></pre></div> |
| <p>To check out a different branch use:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="gp">$</span> <span class="nb">cd </span>wicket |
| <span class="gp">$</span> git checkout -b release/wicket-x.y.z release/wicket-x.y.z |
| <span class="gp">#</span> verify the branch with: |
| <span class="gp">$</span> git branch</code></pre></div> |
| <p>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.</p> |
| <p>The artifacts in this project are there only for having a consistent build. |
| This top-level project doesn’t have sources for itself.</p> |
| <h2 id="building-wicket">Building Wicket</h2> |
| <p>The current development version of Wicket requires at least jdk 6.</p> |
| <p>If you want to ensure that your Wicket version is built using JDK-6 and |
| fully compatible with that Java version, you will need to build it with a Java |
| 6 compiler and runtime library.</p> |
| <p>If you haven’t done so already change into the Wicket root directory:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="go">cd wicket</span></code></pre></div> |
| <p>Now building all of Wicket is as simple as issuing the following command:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="go">mvn install</span></code></pre></div> |
| <p>This will compile, test, package and install all Wicket projects. Installation |
| means putting the jar files into your local Maven repository, including the |
| source, but without the javadoc jars (this is a Wicket specific configuration, |
| because build javadoc takes a long time).</p> |
| <p>The following commands are useful:</p> |
| <table> |
| <tr><th>Commandline</th><th>Description</th></tr> |
| <tr><td>`mvn clean`</td><td>cleans up build artifacts</td></tr> |
| <tr><td>`mvn compile`</td><td>compiles the projects</td></tr> |
| <tr><td>`mvn package`</td><td>creates the jar files in the target/ subdirectories</td></tr> |
| <tr><td>`mvn install`</td><td>installs the jar files in your local repository</td></tr> |
| <tr><td>`mvn -Prelease package`</td><td>generates the javadoc/source jars as well</td></tr> |
| </table> |
| <p>You can just run the install target, as Maven will build the previous stages |
| automatically.</p> |
| <h3 id="coping-with-test-failures">Coping with test failures</h3> |
| <p>As this is our main development you might/will encounter failing unit tests. |
| These can be skipped using:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="go">mvn -Dmaven.test.skip=true install</span></code></pre></div> |
| <p>Of course, all bets are off then and your mileage may vary if you use such a |
| built jar.</p> |
| <h3 id="using-your-own-built-artifacts">Using your own built artifacts</h3> |
| <p>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:</p> |
| <div class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.apache.wicket<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>wicket-core<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>6.0-SNAPSHOT<span class="nt"></version></span> |
| <span class="nt"><scope></span>compile<span class="nt"></scope></span> |
| <span class="nt"></dependency></span></code></pre></div> |
| <p>And adding this to your Eclipse, NetBeans or IntelliJ IDEA project classpath |
| is then as simple as:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="go">mvn eclipse:eclipse</span></code></pre></div> |
| <p>or opening the project using Netbeans or IDEAs Maven integration.</p> |
| <p>Maven will then add all the necessary JAR files to the project’s classpath.</p> |
| <p>One thing you need to make sure is that you have set the <code>M2_REPO</code> classpath |
| variable in Eclipse (or a similar construct in Netbeans), and point it to your |
| local repository, typically found in <code>C:\Documents and Settings\username\.m2\repo</code> |
| or (for unix buffs) <code>~/.m2/repo</code></p> |
| <p>You can add this setting using maven:</p> |
| <div class="highlight"><pre><code class="language-console" data-lang="console"><span class="go">mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo</span></code></pre></div> |
| </section> |
| </div> |
| </main> |
| <footer class="l-container"> |
| <div class="l-full"> |
| <img height="60px" src="/img/asf_logo.gif" style="float:left"> |
| Copyright © 2014 — The Apache Software Foundation. Apache Wicket, |
| Wicket, Apache, the Apache feather logo, and the Apache Wicket |
| project logo are trademarks of The Apache Software Foundation. All |
| other marks mentioned may be trademarks or registered trademarks of |
| their respective owners. |
| </div> |
| </footer> |
| </body> |
| |
| </html> |