camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Building
Date Fri, 26 Feb 2010 07:51:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CAMEL/Building">Building</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h2><a name="Building-Building"></a>Building </h2>

<p>Camel uses <a href="http://maven.apache.org/" rel="nofollow">Maven</a>
as its build tool. If you don't fancy using Maven you can use your IDE directly or <a href="/confluence/display/CAMEL/Download"
title="Download">Download</a> a distribution or JAR.</p>

<h3><a name="Building-Prequisites"></a>Prequisites</h3>

<p><b>Required:</b></p>
<ul>
	<li>Download and <a href="http://maven.apache.org/download.html" rel="nofollow">install
Maven</a>. (Currently Maven 2.0.9 is used to build the official releases, some components
will not build with 2.1+)</li>
	<li>Get the latest <a href="/confluence/display/CAMEL/Source" title="Source">Source</a></li>
	<li>Java 1.5</li>
</ul>


<p><b>Optional:</b></p>
<ul>
	<li><a href="http://www.princexml.com/download/" rel="nofollow">Prince</a>
should be in the executable PATH to generate the PDF documentation</li>
</ul>


<h3><a name="Building-Mavenoptions"></a>Maven options</h3>

<p>To build camel maven has to be configured to use more memory</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m
</pre>
</div></div>

<h3><a name="Building-Anormalbuild"></a>A normal build</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn install
</pre>
</div></div>

<h3><a name="Building-DoingaQuickBuild"></a>Doing a Quick Build</h3>

<p>The following avoids running all the unit test cases, we just skip the test running
phase and not the building part</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn -DskipTests clean install 
</pre>
</div></div>

<h3><a name="Building-UsinganIDE"></a>Using an IDE</h3>

<p>If you prefer to use an IDE then you can auto-generate the IDE's project files using
maven plugins. e.g.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn eclipse:eclipse
</pre>
</div></div>

<p>or</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn idea:idea
</pre>
</div></div>

<h4><a name="Building-AddingCamelEclipsetemplatestoyourworkspace"></a>Adding
Camel Eclipse templates to your workspace</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn -Psetup.eclipse -Declipse.workspace.dir=/path/to/your/workspace
</pre>
</div></div>

<p>You can also find some helpful notes on usage <a href="http://janstey.blogspot.com/2008/08/eclipse-templates-for-apache-camel.html"
rel="nofollow">here</a>. </p>

<h4><a name="Building-ImportingintoEclipse"></a>Importing into Eclipse</h4>
<p>If you have not already done so, you will need to make Eclipse aware of the Maven
repository so that it can build everything. In the preferences, go to Java-&gt;Build Path-&gt;Classpath
and define a new Classpath Variable named M2_REPO that points to your local Maven repository
(i.e., <tt>~/.m2/repository</tt> on Unix and <tt>c:\Documents and Settings\&lt;user&gt;\.m2\repository</tt>
on Windows).</p>

<p>You can also get Maven to do this for you:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn eclipse:add-maven-repo -Declipse.workspace=/path/to/the/workspace/ 
</pre>
</div></div>

<h3><a name="Building-Buildingwithcheckstyle"></a>Building with checkstyle</h3>

<p>To enable source style checking with checkstyle, build Camel with the -Psourcecheck
parameter</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn -Psourcecheck clean install
</pre>
</div></div>

<h3><a name="Building-Buildingsourcejars"></a>Building source jars</h3>
<p>If you want to build jar files with the source code, that for instance Eclipse can
important so you can debug the Camel code as well. Then you can run this command from the
camel root folder:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean source:jar install -Dtest=<span class="code-keyword">false</span>
</pre>
</div></div>

<h3><a name="Building-BuildingwithSpring3.0"></a>Building with Spring 3.0</h3>
<p>Camel is shipped build with Spring 2.5.6. If you want Camel to be build against Spring
3.0 you have to build with the maven profile <tt>spring-3.x</tt>.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean install -Pspring-3.x
</pre>
</div></div>

<p>You may want to skip testing and do a fast build</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean install -Pspring-3.x -Dtest=<span class="code-keyword">false</span>
</pre>
</div></div>

<h3><a name="Building-Workingwithfeatures"></a>Working with features</h3>
<p>If you change anything in the features.xml from <tt>platform/karaf</tt>
you can run a validation step to ensure the generated features.xml file is correct. You can
do this running the following maven goal from the <tt>platform</tt> directory.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean install -Pvalidate
</pre>
</div></div>

<h3><a name="Building-SeeAlso"></a>See Also</h3>

<ul>
	<li><a href="/confluence/display/CAMEL/Running+Unit+Tests" title="Running Unit Tests">Running
Unit Tests</a></li>
	<li><a href="/confluence/display/CAMEL/Source" title="Source">Source</a></li>
	<li><a href="/confluence/display/CAMEL/Examples" title="Examples">Examples</a></li>
</ul>


     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CAMEL/Building">View Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=49126&revisedVersion=29&originalVersion=28">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/Building?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message