servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache ServiceMix > Building
Date Wed, 16 Nov 2011 15:40:01 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/13/_/styles/combined.css?spaceKey=SM&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/SM/Building">Building</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~gliesian">Robert
Liguori</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Reverted from v. 27<br />
    </div>
        <br/>
                         <h4>Changes (8)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2.
Building ServiceMix from Source  <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
Building ServiceMix From Source  <br></td></tr>
            <tr><td class="diff-unchanged" > <br>ServiceMix uses [Maven|http://maven.apache.org/]
as its build and management tool. We have tested the build with Maven 2.0.8 and it works fine,
but Maven 2.0.9 is known to cause some issues that prevent a successful build for ServiceMix
3.2.1 and previous versions.  This has been fixed for 3.2.2 and 3.3. Be sure to read the [FAQ|Build]
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >ServiceMix 4.x requires to use Maven
2.2.1 or better. <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
Prequisites <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Getting started <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*Required:*
<br></td></tr>
            <tr><td class="diff-changed-lines" >* Download and [install <span
class="diff-changed-words">Maven|http://maven.apache.org/download.html<span class="diff-added-chars"style="background-color:
#dfd;">#Installation</span>].</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">
 (Maven 2.2.1 or better is required for ServiceMix 4.x).  <br></td></tr>
            <tr><td class="diff-unchanged" >* Get the latest code [from SVN|Source]
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*
Java 1.6 or better <br>  (Java 1.5 is @deprecated and no longer supported from Camel
2.7 onwards) <br> <br>h2. Building <br> <br></td></tr>
            <tr><td class="diff-unchanged" >* Build the code with the following
command <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="Building-BuildingServiceMixFromSource"></a>Building
ServiceMix From Source </h1>

<p>ServiceMix uses <a href="http://maven.apache.org/" class="external-link" rel="nofollow">Maven</a>
as its build and management tool. We have tested the build with Maven 2.0.8 and it works fine,
but Maven 2.0.9 is known to cause some issues that prevent a successful build for ServiceMix
3.2.1 and previous versions.  This has been fixed for 3.2.2 and 3.3. Be sure to read the <a
href="/confluence/display/SM/Build" title="Build">FAQ</a></p>

<p>ServiceMix 4.x requires to use Maven 2.2.1 or better.</p>

<h2><a name="Building-Gettingstarted"></a>Getting started</h2>

<ul>
	<li>Download and <a href="http://maven.apache.org/download.html#Installation" class="external-link"
rel="nofollow">install Maven</a>.</li>
	<li>Get the latest code <a href="/confluence/display/SM/Source" title="Source">from
SVN</a></li>
	<li>Build the code with the following command</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn -Dmaven.test.skip=<span class="code-keyword">true</span> -Pstep1 install
mvn -Dmaven.test.skip=<span class="code-keyword">true</span> -Pstep2 install
</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>Useful Hints</b><br
/><ul>
	<li>It may happen, that building step1 fails with an error message regarding PMD or
checkstyle. In this case you can add a 'nochecks' to the line so it looks like this:</li>
</ul>


<p><tt>mvn -Dmaven.test.skip=true -Pstep1,nochecks install</tt></p>

<ul>
	<li>Also, if an out of memory error is encountered during compilation, set the MAVEN_OPTS
environment variable to a larger amount of memory. Below is an example:</li>
</ul>


<p><tt>MAVEN_OPTS=-Xmx768m</tt></p>

<ul>
	<li>Some dependencies have POMs that specify repository URLs that are no longer valid.
This can cause invalid artifacts to be downloaded to your local repository. You can add the
following mirror to your maven settings.xml file to avoid this problem:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;mirror&gt;
  &lt;id&gt;servicemix-repo&lt;/id&gt;
  &lt;name&gt;Apache ServiceMix Repository&lt;/name&gt;
  &lt;url&gt;http:<span class="code-comment">//svn.apache.org/repos/asf/servicemix/m2-repo/&lt;/url&gt;
</span>  &lt;mirrorOf&gt;servicemix-repo,servicemix-m2-repo&lt;/mirrorOf&gt;
&lt;/mirror&gt;
</pre>
</div></div></li>
</ul>
</td></tr></table></div>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/forbidden.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Please Note</b><br
/>There is an <a href="https://issues.apache.org/activemq/browse/SM-1079" class="external-link"
rel="nofollow">issue</a> in building if you use the system property style of declaring
the profiles (i.e., -Dprofile=step2) as the XFire Maven plugin thinks step2 is a profile name
it should use. This is fixed in the ServiceMix trunk (3.3 or greater). To work around this
issue, try the following items below: 

<ul>
	<li>Use the -Pstep2 style of declaring the profile as noted above</li>
	<li>Comment out the <a href="http://fisheye6.atlassian.com/browse/servicemix/smx3/tags/servicemix-3.2.1/platforms/pom.xml?r=trunk#l36"
class="external-link" rel="nofollow">Geronimo module in the platform POM</a></li>
</ul>
</td></tr></table></div>

<p>Next time you build, you can just run</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn -Dmaven.test.skip=<span class="code-keyword">true</span> install
</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>Building 3.1.1</b><br
/>If an out of memory error is encountered when building 3.1.1, <br/>
setting the following environmental variable may help

<p>MAVEN_OPTS=-Xmx768m</p></td></tr></table></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>Building 3.0-M1 and 3.0-M2</b><br
/>Note that this only works for versions from 3.0-M3.<br/>
To build previous versions, you need to run:

<p>mvn &#45;N install<br/>
cd tooling<br/>
mvn install &#45;Dmaven.test.skip=true<br/>
cd ..<br/>
mvn install &#45;Dmaven.test.skip=true</p></td></tr></table></div>

<h2><a name="Building-CodeConventions"></a>Code Conventions </h2>

<p>Checkstyle and PMD rules are used to scour the ServiceMix source code when performing
a build. If you are hacking code and it does not follow these conventions, the build will
fail. To make things easier on folks who are using Eclipse, there is an <a href="http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/build/src/main/resources/smx-eclipse-code-conventions.xml?view=markup"
class="external-link" rel="nofollow">Eclipse code convention profile</a> that matches
the Checkstyle conventions, making things a bit easier in this regard. Import this profile
into Eclipse under Preferences-&gt;Java-&gt;Code Style-&gt;Formatter-&gt;Import.
</p>

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

<h3><a name="Building-UsingEclipse"></a>Using Eclipse</h3>
<p>For <a href="http://www.eclipse.org/" class="external-link" rel="nofollow">Eclipse</a>,
a detailed description is given at <a href="/confluence/display/SM/Importing+ServiceMix+into+Eclipse"
title="Importing ServiceMix into Eclipse">Importing ServiceMix into Eclipse</a>.
In addition, this page also describes how to start ServiceMix inside Eclipse with all debugging
possibilities.</p>

<h3><a name="Building-OtherIDEs"></a>Other IDEs</h3>
<p>Any modern IDE with self respect can start a new project based on a Maven pom.xml
file. </p>

<p>Note that you may need to build the whole ServiceMix project once using maven.</p>

<p>Please refer to the <a href="http://maven.apache.org/plugins/index.html" class="external-link"
rel="nofollow">plugin reference</a> for more details on using them.</p>
    </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/SM/Building">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=39144&revisedVersion=29&originalVersion=28">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SM/Building?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message