geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo Development > Building Apache Geronimo
Date Mon, 20 Jun 2011 17:50:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=GMOxDEV&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/GMOxDEV/Building+Apache+Geronimo">Building
Apache Geronimo</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~rglaue">Russell
E Glaue</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        trunk which is G3.0 requires Java 6<br />
    </div>
        <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" >You will need a [JDK 5.0\+ (J2SE 1.5.0+)|http://java.sun.com/j2se/1.5.0]
or compatible JDK to build Apache Geronimo.  It is recommended you use SUN&#39;s implementation,
or something compatible like Apples implementation.  Other JDK vendors implementations may
work, but use at your own risk. <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Java
6 works with trunk and 2.2. Earlier versions may have problems.  Trunk is likely to require
Java 6 soon. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Java
6 works with 2.2. Earlier versions may have problems. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The
Java SDK 6.0 is required for trunk (currently Geronimo 3.0-SNAPSHOT). <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Apache Maven 2 <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <div>
<ul>
    <li><a href='#BuildingApacheGeronimo-Overview'>Overview</a></li>
    <li><a href='#BuildingApacheGeronimo-Prerequisites'>Prerequisites</a></li>
<ul>
    <li><a href='#BuildingApacheGeronimo-JavaDeveloperKit%28JDK%29'>Java Developer
Kit (JDK)</a></li>
    <li><a href='#BuildingApacheGeronimo-ApacheMaven2'>Apache Maven 2</a></li>
    <li><a href='#BuildingApacheGeronimo-Subversion'>Subversion</a></li>
</ul>
    <li><a href='#BuildingApacheGeronimo-CheckoutGeronimo'>Checkout Geronimo</a></li>
    <li><a href='#BuildingApacheGeronimo-PreparingtoBuildfortheFirstTime'>Preparing
to Build for the First Time</a></li>
    <li><a href='#BuildingApacheGeronimo-Building'>Building</a></li>
<ul>
    <li><a href='#BuildingApacheGeronimo-BuildingStages'>Building Stages</a></li>
</ul>
    <li><a href='#BuildingApacheGeronimo-TestingtheAssembly'>Testing the Assembly</a></li>
<ul>
    <li><a href='#BuildingApacheGeronimo-usingthegeronimomavenplugin'>using the
geronimo-maven-plugin</a></li>
    <li><a href='#BuildingApacheGeronimo-orbyhand'>or by hand</a></li>
</ul>
    <li><a href='#BuildingApacheGeronimo-IDESetup'>IDE Setup</a></li>
<ul>
    <li><a href='#BuildingApacheGeronimo-IntellijIDEA'>Intellij IDEA</a></li>
    <li><a href='#BuildingApacheGeronimo-Eclipse'>Eclipse</a></li>
</ul>
    <li><a href='#BuildingApacheGeronimo-Troubleshooting'>Troubleshooting</a></li>
</ul></div>

<h2><a name="BuildingApacheGeronimo-Overview"></a>Overview</h2>

<p>This documents how to build the Apache Geronimo Server project.</p>

<p>This guide is intended to cover how to build the latest <tt>server/trunk</tt>,
though other newer branches should also follow similar instructions.  Server trees that use
the same basic build tooling include:</p>
<ul>
	<li><tt>server/trunk</tt></li>
	<li><tt>server/branches/2.2</tt></li>
	<li><tt>server/branches/2.1</tt></li>
	<li><tt>server/branches/2.0</tt></li>
	<li><tt>server/branches/1.2</tt> (not tested recently)</li>
</ul>


<h2><a name="BuildingApacheGeronimo-Prerequisites"></a>Prerequisites</h2>


<h3><a name="BuildingApacheGeronimo-JavaDeveloperKit%28JDK%29"></a>Java
Developer Kit (JDK)</h3>

<p>You will need a <a href="http://java.sun.com/j2se/1.5.0" class="external-link"
rel="nofollow">JDK 5.0&#43; (J2SE 1.5.0+)</a> or compatible JDK to build Apache
Geronimo.  It is recommended you use SUN's implementation, or something compatible like Apples
implementation.  Other JDK vendors implementations may work, but use at your own risk.</p>

<p>Java 6 works with 2.2. Earlier versions may have problems.</p>

<p>The Java SDK 6.0 is required for trunk (currently Geronimo 3.0-SNAPSHOT).</p>

<h3><a name="BuildingApacheGeronimo-ApacheMaven2"></a>Apache Maven 2</h3>

<p>To execute the build process you need to have <a href="http://maven.apache.org"
class="external-link" rel="nofollow">Apache Maven</a> version <tt>2.0.10</tt>
(or newer) installed.  For 3.0, you need version <tt>2.2.1</tt> or later.</p>

<p>To check if your installation is working and you have the required minimum version
run:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -version
</pre>
</div></div>
<p>And it should produce something like:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>Maven version: 2.0.10
</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>maven repository</b><br
/>Add the following to your <tt>settings.xml</tt> for maven so that you can
avoid the redirect (and hence avoid the bogus poms/jars) and get beyond compilation failure
problem to build Geronimo using maven. See <a href="http://old.nabble.com/Could-not-build-Geronimo-server-from-SVN-branch-2.2-to26273830s134.html"
class="external-link" rel="nofollow">this message</a> for more details.
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>excerpt of setting.xml for maven</b></div><div
class="codeContent panelContent">
<pre class="code-xml">
...
   <span class="code-tag">&lt;mirrors&gt;</span>
       <span class="code-tag">&lt;mirror&gt;</span>
           <span class="code-tag">&lt;id&gt;</span>java.net<span class="code-tag">&lt;/id&gt;</span>
           <span class="code-tag">&lt;name&gt;</span>Mirror of https://maven-repository.dev.java.net/nonav/repository/<span
class="code-tag">&lt;/name&gt;</span>
           <span class="code-tag">&lt;url&gt;</span>http://download.java.net/maven/2/<span
class="code-tag">&lt;/url&gt;</span>
           <span class="code-tag">&lt;mirrorOf&gt;</span>java.net<span
class="code-tag">&lt;/mirrorOf&gt;</span>
       <span class="code-tag">&lt;/mirror&gt;</span>
   <span class="code-tag">&lt;/mirrors&gt;</span>
...
</pre>
</div></div></td></tr></table></div>

<p>If you have an incompatible version the server build will probably fail with a message
complaining <img class="emoticon" src="/confluence/images/icons/emoticons/wink.gif" height="20"
width="20" align="absmiddle" alt="" border="0"/></p>

<h3><a name="BuildingApacheGeronimo-Subversion"></a>Subversion</h3>

<p>To fetch the source code for the server, you will need to have a <a href="http://subversion.tigris.org/"
class="external-link" rel="nofollow">Subversion</a> client version 1.5 (or newer,
1.5 is recommended) installed.</p>
<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>Windows Tip</b><br
/>Windows users are <b>strongly encouraged</b> to change the M2 local repository
(the place where dependencies are downloaded) to a shorter path with no spaces, e.g. <tt>C:\.m2</tt>.

<p>Using a longer path may cause the build (and Geronimo itself) to behave very strangely
when it hits the 260 char limit for filenames on Windows.</p>

<p>In order to change the m2 local repository go to <tt>%USERPROFILE%\.m2</tt>
and edit or create <tt>settings.xml</tt> file to contain the following content:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>?&gt;</span>
<span class="code-tag">&lt;settings&gt;</span>
    <span class="code-tag">&lt;localRepository&gt;</span>C:\.m2<span
class="code-tag">&lt;/localRepository&gt;</span>
<span class="code-tag">&lt;/settings&gt;</span>
</pre>
</div></div></td></tr></table></div>

<h2><a name="BuildingApacheGeronimo-CheckoutGeronimo"></a>Checkout Geronimo</h2>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>svn co https://svn.apache.org/repos/asf/geronimo/server/trunk server
</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>Tip</b><br />If
you are using Chinese system, please change your locale to en_US. Otherwise, the maven 2.0.7(or
below) can't parse Chinese characters.</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>Windows Tip</b><br
/>Windows users are <b>strongly encouraged</b> to checkout Geronimo into <tt>c:\g</tt>.

<p>Using a longer path may cause the build (and Geronimo itself) to behave very strangely
when it hits the 260 char limit for filenames on Windows.</p></td></tr></table></div>

<h2><a name="BuildingApacheGeronimo-PreparingtoBuildfortheFirstTime"></a>Preparing
to Build for the First Time</h2>

<p>Chances are you will need to increase the heap size for Maven.  Add the following
lines to <tt>&#126;/.mavenrc</tt>:</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td>The following snips only set <tt>MAVEN_OPTS</tt>
if its not already set, so that you can override these values on the command line if needed.</td></tr></table></div>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre># Increase the heap size Maven
if [ "x$MAVEN_OPTS" = "x" ]; then
    MAVEN_OPTS=-Xmx512m
fi
</pre>
</div></div>
<p>If you are using the SUN JDK (or a JDK with compatible flags, like the Apple JDK),
you should also increase the maximum permanent size as well as the heap:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre># Increase the heap and max permanent size for Maven
if [ "x$MAVEN_OPTS" = "x" ]; then
    MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=64m"
fi
</pre>
</div></div>
<p>For 3.0, use at least:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>    MAVEN_OPTS="-Xmx768m -XX:MaxPermSize=200m"
</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>Windows Tip</b><br
/>Windows users should create <tt>mavenrc_pre.bat</tt> under <tt>c:\documents
and settings\&lt;username&gt;\mavenrc_pre.bat</tt> or <tt>c:\mavenrc_pre.bat</tt>
depending on how the <tt>%HOME%</tt> property is set on your system.

<p>Variables will need to use the batch set syntax:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>set &lt;VARIABLE&gt;=&lt;VALUE&gt;
</pre>
</div></div></td></tr></table></div>

<h2><a name="BuildingApacheGeronimo-Building"></a>Building</h2>

<p>To build all changes incrementally:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn install
</pre>
</div></div>
<p>To perform clean builds, which are sometimes needed after some changes to the source
tree:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn clean install
</pre>
</div></div>


<h3><a name="BuildingApacheGeronimo-BuildingStages"></a>Building Stages</h3>

<p>In some cases you may need to build Geronimo in stages, such as when you have changed
the geronimo version.  Most users will not need to do this, but its documented here for clarity.</p>

<p>To build modules, testsupport and maven-plugins:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn install -Dstage=bootstrap
</pre>
</div></div>
<p>To build apps, configs and assemblies:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn install -Dstage=assemble
</pre>
</div></div>
<p>As mentioned, most users will not need to build Geronimo in stages.  But in some
cases, when bootstrapping new versions (when no artifacts are deployed into remote repositories
for the current version), then you <b>must</b> build the stages separately for
the <em>first</em> build and then for all builds afterwards, the staged build
is not necessary.</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td>Using Sonatype nexus can help
make large maven builds faster and more reliable.  However you have to configure all the repositories
specified in the geronimo poms in your nexus instance.</td></tr></table></div>

<h2><a name="BuildingApacheGeronimo-TestingtheAssembly"></a>Testing the
Assembly</h2>
<h3><a name="BuildingApacheGeronimo-usingthegeronimomavenplugin"></a>using
the geronimo-maven-plugin</h3>
<p>Once you have build the server fully, which will produce a number of <tt>zip</tt>
and <tt>tar.gz</tt> archives from the assembly modules, you can use the <tt>geronimo-maven-plugin</tt>
to start the server.  From the project root directory run:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -Ptools geronimo:start
</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>Windows Tip</b><br
/>Windows users may need to specify an alternative <tt>installDirectory</tt>
to avoid long path problems:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -Ptools geronimo:start -DinstallDirectory=c:\g
</pre>
</div></div></td></tr></table></div>
<p>And to stop, either <tt>CTRL-C</tt> or from a separate terminal, from
the project root directory run:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -Ptools geronimo:stop
</pre>
</div></div>

<h3><a name="BuildingApacheGeronimo-orbyhand"></a>or by hand</h3>
<p>cd assemblies/geronimo/jetty6-javaee5/target<br/>
tar xzf geronimo-jetty6-javaee5-&lt;version&gt;-bin.tar.gz<br/>
./geronimo-jetty-javaee5-&lt;version&gt;/bin/gsh geronimo/start-server</p>

<h2><a name="BuildingApacheGeronimo-IDESetup"></a>IDE Setup</h2>

<p>The server project does not have any IDE files checked in since major IDEs have better
support for maven than maven for them.</p>
<h3><a name="BuildingApacheGeronimo-IntellijIDEA"></a>Intellij IDEA</h3>

<p>For the IDEA 8.1 and later:<br/>
The project is too large to easily open at once in IDEA. Generally the framework project and
individual plugins are a good size to work with. In the maven projects tab, check the it profile
to get more of the maven projects.</p>

<h3><a name="BuildingApacheGeronimo-Eclipse"></a>Eclipse</h3>
<p>Use the maven2 eclipse:eclipse plugin.  See <a href="/confluence/display/GMOxDEV/Developing+Geronimo+in+Eclipse"
title="Developing Geronimo in Eclipse">Developing Geronimo in Eclipse</a> for detailed
instructions. As for IDEA, opening framework or individual plugins is more likely to work
than trying to open the whole project.  </p>

<h2><a name="BuildingApacheGeronimo-Troubleshooting"></a>Troubleshooting</h2>

<p>If you're building the 2.0 branch and the build fails because it can't find an xbean
jar (for example org.apache.xbean:xbean-naming:jar:3.2-r579367), then add the</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>http://svn.apache.org/repos/asf/openejb/repo/
</pre>
</div></div>
<p> repository to the <tt>pom.xml</tt> file in the root of the source tree.
 See <a href="http://mail-archives.apache.org/mod_mbox/geronimo-dev/200710.mbox/%3cAC0FF32B-74DD-4BF1-ADD3-635559FEFB75@hogstrom.org%3e"
class="external-link" rel="nofollow">this message</a> for more details.</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/GMOxDEV/Building+Apache+Geronimo">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=7678&revisedVersion=151&originalVersion=150">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDEV/Building+Apache+Geronimo?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message