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 Thu, 23 Jun 2011 19:42: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>
        Per the dev@G thread "Restricting build to only one assembly" 2011-06-23, builds can
be refined to assembly types<br />
    </div>
        <br/>
                         <h4>Changes (11)</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" >h3. Java Developer Kit (JDK) <br>
<br></td></tr>
            <tr><td class="diff-changed-lines" >You will need a [JDK 6.0\+ (Java
SE <span class="diff-changed-words">1.6.0<span class="diff-added-chars"style="background-color:
#dfd;">\</span>+</span> SDK)|http://www.oracle.com/technetwork/java/javase/downloads/index.html|Java
SE 1.6] or compatible JDK to build Apache Geronimo from trunk.  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></td></tr>
            <tr><td class="diff-unchanged" > <br>*{+}Apache Geronimo 2.2{+}*
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >*{+}For Apache Geronimo 2.2, use
at <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">least:{+}*</span>
<span class="diff-added-words"style="background-color: #dfd;">least:+*</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>if [ &quot;x$MAVEN_OPTS&quot;
= &quot;x&quot; ]; then <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h3. Build Options <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*{+}HeapDumpOnOutOfMemoryError{+}*
<br></td></tr>
            <tr><td class="diff-unchanged" >Add the HeapDumpOnOutOfMemoryError
flag to MAVEN_OPTS to get a dump on OutOfMemory errors <br>{noformat} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*{+}Skip
tests{+}* <br></td></tr>
            <tr><td class="diff-changed-lines" >Use <span class="diff-changed-words"><span
class="diff-added-chars"style="background-color: #dfd;">\</span>-DskipTests=true</span>
to turn off tests during server build. You can use this flag if you are simply running a build
to save a little more time. However, you should not use this flag if you are making code changes,
as you should want to build with the tests to make sure your changes do not break anything.
Testing the build is necessary if you are submitting a patch or code change recommendations.
<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>mvn clean install
-DskipTests=true <br>{noformat} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*{+}Build
offline{+}* <br></td></tr>
            <tr><td class="diff-changed-lines" >You can also build in an offline
mode. Use <span class="diff-changed-words"><span class="diff-added-chars"style="background-color:
#dfd;">\</span>-o</span> to avoid searching remote repositories to save more
time. However, you have to complete one full online build before this will work so that all
dependencies will be downloaded into your local maven repository. After the first complete
build, using the <span class="diff-changed-words"><span class="diff-added-chars"style="background-color:
#dfd;">\</span>-o</span> flag will cause maven to only use what you have locally
and not search remote repositories. <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>mvn -o clean
install <br>{noformat} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">To
get Maven to provide you with more error details, use -X to get stack traces on errors. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*{+}More
error and debug information{+}* <br>To get Maven to provide you with more error details,
use \-e to get stack traces on errors, and use \-X to produce execution debug output. <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>mvn -X clean
install <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">mvn
-e clean install <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*{+}Restricting
a build to only one assembly{+}* <br>If your only interested in either the tomcat or
jetty assemblies, you can save build time by indicating which of these assembly types should
be built. There are two profiles in the {{geronimo/server/trunk/assemblies/pom.xml}} named
{{tomcat}} and {{jetty}}. To only build the tomcat assemblies and not the jetty ones, you
would indicate it like this: <br>{noformat} <br>mvn clean install -Ptomcat <br>{noformat}
<br> <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Geronimo Assemblies Resulting
from the Build <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>
    <li><a href='#BuildingApacheGeronimo-BuildOptions'>Build Options</a></li>
    <li><a href='#BuildingApacheGeronimo-GeronimoAssembliesResultingfromtheBuild'>Geronimo
Assemblies Resulting from the Build</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>


<p><b><ins>nightly built snapshots from trunk</ins></b><br/>
If you are only interested in obtaining a compiled binary of what is most recent in trunk,
this is already made available. Geronimo <tt>server/trunk</tt> is built from the
repository on a nightly basis, and the resulting compiled binaries are available as snapshots
on <a href="https://repository.apache.org/content/groups/snapshots/" class="external-link"
rel="nofollow">Apache's Snapshot Repository</a>. Particularly you will want the <a
href="https://repository.apache.org/content/groups/snapshots/org/apache/geronimo/assemblies/"
class="external-link" rel="nofollow">Apache Geronimo assemblies</a> which is what
is published when Geronimo is released as a major revision.</p>

<p>Typically one would compile Geronimo when testing code modifications, otherwise the
snapshots the Geronimo community provides is sufficient for testing the latest code from the
repository. And when submitting a bug, the community appreciates if these latest Geronimo
assemblies can be tested for the bug to make sure we haven't already fixed it.&nbsp;</p>

<p><b><ins>other relevant documentation</ins></b><br/>
The Geronimo community also maintains build documentation specific to each Geronimo version.
While the community attempts to keep all these related docs in sync with each other, you may
find some varying information among them.</p>
<ul>
	<li><a href="/confluence/display/GMOxDOC30/Building+Geronimo+with+Maven" title="Building
Geronimo with Maven">Geronimo 3.0: Building Geronimo with Maven</a></li>
	<li><a href="/confluence/display/GMOxDOC22/Building+Geronimo+with+Maven" title="Building
Geronimo with Maven">Geronimo 2.2: Building Geronimo with Maven</a></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://www.oracle.com/technetwork/java/javase/downloads/index.html"
title="Java SE 1.6" class="external-link" rel="nofollow">JDK 6.0&#43; (Java SE 1.6.0&#43;
SDK)</a> or compatible JDK to build Apache Geronimo from trunk.  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><b><ins>Apache Geronimo 2.2</ins></b><br/>
<a href="http://www.oracle.com/technetwork/java/javase/index-jsp-135232.html" class="external-link"
rel="nofollow">JDK 5.0&#43; (J2SE 1.5.0+)</a> or compatible JDK.<br/>
The Java SE (JDK) 6.0 works with Geronimo 2.2.</p>

<p><b><ins>Apache Geronimo 2.1 and earlier</ins></b><br/>
<a href="http://www.oracle.com/technetwork/java/javase/index-jsp-135232.html" class="external-link"
rel="nofollow">JDK 5.0&#43; (J2SE 1.5.0+)</a> or compatible JDK.</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 should not double-quote JAVA_HOME (or MAVEN_HOME for the same reason),
according to <a href="http://jira.codehaus.org/browse/MAVEN-666" class="external-link"
rel="nofollow">MAVEN-666</a>.<br/>
Setting:<br/>
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_20"<br/>
doesn't work, but this does:<br/>
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20</td></tr></table></div>


<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.2.1</tt>
(or newer) installed to build Apache Geronimo from trunk.</p>

<p><b><ins>Apache Geronimo 2.2</ins></b><br/>
<a href="http://maven.apache.org" class="external-link" rel="nofollow">Apache Maven</a>
version <tt>2.0.10</tt> (or newer)</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.2.1
</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
/>When building Geronimo 2.2. 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="-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=64m"
fi
</pre>
</div></div>

<p><b><ins>For Apache Geronimo 2.2, use at least:</ins></b></p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>if [ "x$MAVEN_OPTS" = "x" ]; then
    MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=64m"
fi
</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>

<h3><a name="BuildingApacheGeronimo-BuildOptions"></a>Build Options</h3>

<p><b><ins>HeapDumpOnOutOfMemoryError</ins></b><br/>
Add the HeapDumpOnOutOfMemoryError flag to MAVEN_OPTS to get a dump on OutOfMemory errors</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>-XX:+HeapDumpOnOutOfMemoryError
</pre>
</div></div>

<p><b><ins>Skip tests</ins></b><br/>
Use &#45;DskipTests=true to turn off tests during server build. You can use this flag
if you are simply running a build to save a little more time. However, you should not use
this flag if you are making code changes, as you should want to build with the tests to make
sure your changes do not break anything. Testing the build is necessary if you are submitting
a patch or code change recommendations.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn clean install -DskipTests=true
</pre>
</div></div>

<p><b><ins>Build offline</ins></b><br/>
You can also build in an offline mode. Use &#45;o to avoid searching remote repositories
to save more time. However, you have to complete one full online build before this will work
so that all dependencies will be downloaded into your local maven repository. After the first
complete build, using the &#45;o flag will cause maven to only use what you have locally
and not search remote repositories.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -o clean install
</pre>
</div></div>

<p><b><ins>More error and debug information</ins></b><br/>
To get Maven to provide you with more error details, use &#45;e to get stack traces on
errors, and use &#45;X to produce execution debug output.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -X clean install
mvn -e clean install
</pre>
</div></div>

<p><b><ins>Restricting a build to only one assembly</ins></b><br/>
If your only interested in either the tomcat or jetty assemblies, you can save build time
by indicating which of these assembly types should be built. There are two profiles in the
<tt>geronimo/server/trunk/assemblies/pom.xml</tt> named <tt>tomcat</tt>
and <tt>jetty</tt>. To only build the tomcat assemblies and not the jetty ones,
you would indicate it like this:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn clean install -Ptomcat
</pre>
</div></div>



<h3><a name="BuildingApacheGeronimo-GeronimoAssembliesResultingfromtheBuild"></a>Geronimo
Assemblies Resulting from the Build</h3>

<p>After a complete build has successfully finished, the resulting assemblies are located
in associated subdirectories of <tt>BUILDROOT/framework/assemblies</tt>. These
are the same as what are provided from the nightly Apache Geronimo Snapshots.</p>


<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 for some reason maven is unable to download and install an artifact, and the build
stops with an error complaining of such, you will need to manually download the archive and
install it in your local maven repository. You can do that with a maven command similar to
this:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn install:install-file -DgroupId=org.apache.geronimo.framework -DartifactId=geronimo-kernel
-Dversion=jar -Dpackaging=3.0-20110608.081951-139 -Dfile=/path/to/file-artifact.jar
</pre>
</div></div>

<p>Maven can download and install dependencies for you:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn dependency:get -DrepoUrl=https://repository.apache.org/content/groups/snapshots/
-Dartifact="org.apache.geronimo.framework:geronimo-kernel:jar:3.0-20110608.081951-139"
</pre>
</div></div>

<p>You will need to figure out which repository the artifact is available from. Look
in the <tt>BUILD_ROOT/pom.xml</tt> file within the <tt>&lt;repositories&gt;</tt>
tag to see the primary repositories utilized. You can also review the build output to see
where maven attempted to download the artifact from.</p>


<p><b><ins>Apache Geronimo 2.0</ins></b><br/>
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=156&originalVersion=155">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