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 Mon, 08 Apr 2013 19:37:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Building">Building</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~dkulp">Daniel
Kulp</a>
    </h4>
        <br/>
                         <h4>Changes (3)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >To build camel maven has to be configured
to use more memory <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h5.
Unix/Linux/Mac <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">set</span>
<span class="diff-added-words"style="background-color: #dfd;">export</span> MAVEN_OPTS=&quot;-Xmx1024m
-XX:MaxPermSize=512m&quot; <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h5.
Windows <br>{code} <br>set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m <br>{code}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. A normal build <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Building-BuildingCamelfromSource"></a>Building Camel
from Source</h2>

<p>Camel uses <a href="http://maven.apache.org/" class="external-link" rel="nofollow">Maven</a>
as its build and management 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" class="external-link"
rel="nofollow">install Maven</a>.<br/>
  (Maven 2.2.1 or better is required to build Camel 2.5 onwards).<br/>
  (Maven 3.0.2 or better is required to build Camel 2.10 onwards).<br/>
  (Maven 3.0.4 or better is required to build Camel 2.11 onwards).</li>
	<li>Get the latest <a href="/confluence/display/CAMEL/Source" title="Source">Source</a></li>
	<li>Java 1.6<br/>
  (Java 1.5 is @deprecated and no longer supported from Camel 2.7 onwards)<br/>
  (Java 1.7 is supported from Camel 2.10 onwards)</li>
</ul>


<p><b>Optional:</b></p>
<ul>
	<li><a href="http://www.princexml.com/download/" class="external-link" 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>

<h5><a name="Building-Unix%2FLinux%2FMac"></a>Unix/Linux/Mac</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
export MAVEN_OPTS=<span class="code-quote">"-Xmx1024m -XX:MaxPermSize=512m"</span>
</pre>
</div></div>
<h5><a name="Building-Windows"></a>Windows</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
</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 clean install
</pre>
</div></div>

<h3><a name="Building-Anormalbuildwithoutrunningtests"></a>A normal build
without running tests</h3>

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

<h3><a name="Building-Anormalbuildwithoutrunningtestsbutcheckstyleverificationenabled"></a>A
normal build without running tests but checkstyle verification enabled</h3>

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

<h3><a name="Building-DoingaQuickBuild"></a>Doing a Quick Build</h3>
<p><b>Available as of Camel 2.6</b></p>

<p>The following skips building the manual, the distro and does not execute the unit
tests.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn install -Pfastinstall
</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>

<h4><a name="Building-IntelliJ"></a>IntelliJ</h4>
<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-Eclipse"></a>Eclipse</h4>
<p>There are several ways to import the projects into Eclipse.</p>
<h5><a name="Building-m2e"></a>m2e</h5>
<p>At this point, usage of the m2e plugins to import Camel into Eclipse is untested
and unsupported.  Patches, notes, etc... to help get this supported would be more than welcome.</p>

<h5><a name="Building-maveneclipseplugin"></a>maven-eclipse-plugin</h5>
<p>The maven-eclipse-plugin can be used to generate the .classpath/.project/.settings
file that Eclipse need.  To do this, run:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn process-test-sources 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 -Psetup.eclipse -Declipse.workspace.dir=/path/to/your/workspace
</pre>
</div></div>

<p>The latter is recommended as it would completely setup the workspace for you as well
as provide options to wire in other projects also found in your workspace.</p>

<p>After running the above command, from within Eclipse, do "File -&gt; Import -&gt;
Existing Projects into Workspace", select the root camel checkout location and Eclipse should
find all the projects.  </p>

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

<p>The above mentioned setup.eclipse profile does a few additional things to your workspace:</p>

<ol>
	<li>Adds the Camel code templates (see <a href="http://janstey.blogspot.com/2008/08/eclipse-templates-for-apache-camel.html"
class="external-link" rel="nofollow">here</a>)</li>
</ol>


<ol>
	<li>Sets the M2_REPO variable in the workspace 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) which allows the jars to be resolved.</li>
</ol>


<h5><a name="Building-Hint%3Aspecifytheworkspacelocationinyour.m2%2Fsettings.xml"></a>Hint:
specify the workspace location in your .m2/settings.xml</h5>
<p>You can add a profile to your .m2/settings.xml to specify your eclipse workspace
location so you can avoid having to type that each time you need to update the projects.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;profiles&gt;</span>
    <span class="code-tag">&lt;profile&gt;</span>
        <span class="code-tag">&lt;id&gt;</span>setup.eclipse<span
class="code-tag">&lt;/id&gt;</span>
        <span class="code-tag">&lt;properties&gt;</span>
            <span class="code-tag">&lt;eclipse.workspace&gt;</span>/path/to/your/workspace<span
class="code-tag">&lt;/eclipse.workspace&gt;</span>
        <span class="code-tag">&lt;/properties&gt;</span>
    <span class="code-tag">&lt;/profile&gt;</span>
<span class="code-tag">&lt;/profiles&gt;</span>
</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 -Pfastinstall
</pre>
</div></div>

<h3><a name="Building-BuildingwithSpring3.0"></a>Building with Spring 3.0</h3>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td>Support for Spring
3.0 is deprecated from Camel 2.11 onwards.</td></tr></table></div>

<p>From Camel 2.11.0 onwards, if you want Camel to be build against Spring 3.0 you have
to build with the maven profile <tt>spring3.0</tt>.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean install -Pspring3.0
</pre>
</div></div>

<h3><a name="Building-BuildingwithSpring3.1"></a>Building with Spring 3.1</h3>
<p>From Camel 2.10.0 onwards, if you want Camel to be build against Spring 3.1 you have
to build with the maven profile <tt>spring3.1</tt>.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean install -Pspring3.1
</pre>
</div></div>

<p><b>Note:</b> the <tt>camel-test-spring</tt> component requires
to be built with Spring 3.1.</p>

<h3><a name="Building-BuildingwithSpring3.2"></a>Building with Spring 3.2</h3>
<p>From Camel 2.11.0 onwards, if you want Camel to be build against Spring 3.2 you have
to build with the maven profile <tt>spring3.2</tt>.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean install -Pspring3.2
</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="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Building">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=49126&revisedVersion=54&originalVersion=53">View
Changes</a>
                |
        <a href="https://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