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 Thu, 06 Jun 2013 07:35: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/~bvahdat">Babak
Vahdat</a>
    </h4>
        <br/>
                         <h4>Changes (1)</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" >mvn process-test-sources eclipse:eclipse
<br>{code} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>{tip:title=Enable the apt Profile *explicitly* if using Java 6} <br>Per default
this profile is enabled only when using Java 7+ however for many of the Camel components you
would still need the {{org.apache.camel:spi-annotations}} Maven module on the class path inside
the generated {{.classpath}} of many Camel components. To force this on Java 6 do: <br>{code}
<br>mvn -P apt process-test-sources eclipse:eclipse <br>{code} <br>As otherwise
some of the Camel components inside your eclipse workspace would not compile (when using Java
6) because the {{org.apache.camel:spi-annotations}} Maven module would be missing on the class
path. <br>{tip} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >or <br>{code} <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 does not work
due to plugins without LifeCycle hints, bundle plugin configuration problems, etc...  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>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td><b>Enable the apt Profile
<b>explicitly</b> if using Java 6</b><br />Per default this profile
is enabled only when using Java 7+ however for many of the Camel components you would still
need the <tt>org.apache.camel:spi-annotations</tt> Maven module on the class path
inside the generated <tt>.classpath</tt> of many Camel components. To force this
on Java 6 do:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn -P apt process-test-sources eclipse:eclipse
</pre>
</div></div>
<p>As otherwise some of the Camel components inside your eclipse workspace would not
compile (when using Java 6) because the <tt>org.apache.camel:spi-annotations</tt>
Maven module would be missing on the class path.</p></td></tr></table></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>
	<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>From Camel 2.11.0 onwards, Spring 3.1 is the default.</p>

<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>

<p>From Camel 2.12.0 onwards, Spring 3.2 is the default.</p>

<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=58&originalVersion=57">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