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 Wed, 10 Aug 2011 14:14: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>
        adding headers to two troubleshooting sections<br />
    </div>
        <br/>
                         <h4>Changes (2)</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" >h2. Troubleshooting <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
Build was not able to download and install artifacts <br></td></tr>
            <tr><td class="diff-unchanged" >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: <br>{noformat} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
Build can&#39;t find xbean jar <br></td></tr>
            <tr><td class="diff-unchanged" >*{+}Apache Geronimo 2.0{+}* <br>If
you&#39;re building the 2.0 branch and the build fails because it can&#39;t find an
xbean jar (for example org.apache.xbean:xbean-naming:jar:3.2-r579367), then add the <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-BuildMachine'>Build Machine</a></li>
    <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>
    <li><a href='#BuildingApacheGeronimo-Buildwasnotabletodownloadandinstallartifacts'>Build
was not able to download and install artifacts</a></li>
    <li><a href='#BuildingApacheGeronimo-OverridinglibrariesprovidedbyJVMinbuildtime'>Overriding
libraries provided by JVM in build time</a></li>
    <li><a href='#BuildingApacheGeronimo-Buildcan%27tfindxbeanjar'>Build can't
find xbean jar</a></li>
</ul>
</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-BuildMachine"></a>Build Machine</h3>

<p>It is recommended that a dedicated computer used to build <tt>server/trunk</tt>
have a minimum of 2GB of real memory. The computer will also need a connection to the Internet
to download artifact dependencies.</p>

<p><b><ins>Build Time</ins></b><br/>
The first-time-build will download all artifact dependencies into your local maven repository,
so the build time will partly depend on the speed of your internet connection. The builds
that are executed after the first complete build will be faster because the artifact dependencies
are already downloaded during the first build. As Geronimo trunk is being developed as SNAPSHOT
(e.g. Geronimo 3.0-SNAPSHOT), it also depends on 3rd-party artifacts that are being released
as SNAPSHOTs. As a result, new artifacts will be downloaded as snapshots are released, which
is a daily occurrence.</p>

<p>As of June 2011 the following build time results were recorded:</p>
<ul>
	<li>90 minutes - one 2.4GHz dual-core CPU; 2GB of real memory; 2Mb Internet connection;
empty local maven repository (first build)</li>
	<li>13+ hours - two 2.0GHz dual-core CPUs; 1GB of real memory; 2Mb Internet connection;
populated maven repository; (not first build)</li>
</ul>


<p>The available real memory makes a big difference. During the build process, maven
self-loads the artifacts it builds. Having enough real memory allows the build process to
quickly start up the dependencies that are built. Without enough memory, your real memory
must be swapped so the dependencies can be started, and then swapped again to go back to the
build process.</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>Build Tips</b><br
/>Refer to the <b>Build Options</b> section below for more options that can
speed up your build time.</td></tr></table></div>


<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. Maven 3.0 can also be used to build
trunk.</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>

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

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

<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://apache-geronimo.328035.n3.nabble.com/Could-not-build-Geronimo-server-from-SVN-branch-2-2-td409663.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>


<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>.<br/>
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>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>.<br/>
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.</td></tr></table></div>

<p>You can also use Git mirrors to checkout Geronimo source code, and make sure you
have a Git client installed before using the following command:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>git clone git://git.apache.org/geronimo server
</pre>
</div></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>
<p>You should be able to do this with built-in maven stuff, see <a href="http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-advanced-reactor-options/"
class="external-link" rel="nofollow">maven tips and tricks advanced reactor options</a>.<br/>
Example: This should build everything needed for the named assembly including the assembly:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn clean install -pl :geronimo-tomcat7-javaee6 -am
</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 target subdirectories of each assembly. These are the same as what are provided
from the nightly Apache Geronimo Snapshots.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>BUILD_ROOT/assemblies/geronimo-jetty8-javaee6/target/geronimo-jetty8-javaee6-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/assemblies/geronimo-jetty8-javaee6-web/target/geronimo-jetty8-javaee6-web-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/assemblies/geronimo-tomcat7-minimal/target/geronimo-tomcat7-minimal-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/assemblies/geronimo-tomcat7-javaee6/target/geronimo-tomcat7-javaee6-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/assemblies/geronimo-tomcat7-javaee6-web/target/geronimo-tomcat7-javaee6-web-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/assemblies/geronimo-jetty8-minimal/target/geronimo-jetty8-minimal-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/plugins/clustering/geronimo-plugin-farm-node/target/geronimo-plugin-farm-node-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/framework/assemblies/geronimo-framework/target/geronimo-framework-3.0-SNAPSHOT-bin(.tar.gz|.zip)
BUILD_ROOT/framework/modules/geronimo-plugin/target/test-resources/ArchiverGBeanTest/server1/bar-1.0-bin(.tar.gz|.zip)
</pre>
</div></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>

<h3><a name="BuildingApacheGeronimo-Buildwasnotabletodownloadandinstallartifacts"></a>Build
was not able to download and install artifacts</h3>
<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>

<h3><a name="BuildingApacheGeronimo-OverridinglibrariesprovidedbyJVMinbuildtime"></a>Overriding
libraries provided by JVM in build time</h3>
<p>In some cases, Java EE 6 requires newer library versions then what is provided by
Java SE 6. For example, EE 6 requires annotations 1.1 api but SE 6 provides annotation 1.0
api. So it is necessary that during a build we override the JVM provided libraries with newer
versions.</p>

<p>You can use <tt>geronimo-property-plugin</tt> in the pom.xml file of
artifacts to set _<em>bootClassPath</em>_ property which is used by <tt>maven-compiler-plugin</tt>
and <tt>maven-surefire-plugin</tt> as followed. The <tt>geronimo-property-plugin</tt>
executes in the <b>validate</b> phase and sets _<em>bootClassPath</em>_
system property. The value of _<em>bootClassPath</em>_ property is set to _<em><b>-Xbootclasspath/p:&lt;path&gt;&lt;pathSeparator&gt;&lt;path&gt;...</b></em>_
string where each <b>&lt;path&gt;</b> is the jar file to place in the
front of boot classpath.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent
panelContent">
<pre class="code-xml">
...
            <span class="code-tag">&lt;plugin&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.buildsupport<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>geronimo-property-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;configuration&gt;</span>
                    <span class="code-tag">&lt;propertyName&gt;</span>bootClassPath<span
class="code-tag">&lt;/propertyName&gt;</span>
                    <span class="code-tag">&lt;propertyValuePrefix&gt;</span>-Xbootclasspath/p:<span
class="code-tag">&lt;/propertyValuePrefix&gt;</span>
                    <span class="code-tag">&lt;classpath&gt;</span>
                        <span class="code-tag">&lt;dependency&gt;</span>
                            <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.specs<span
class="code-tag">&lt;/groupId&gt;</span>
                            <span class="code-tag">&lt;artifactId&gt;</span>geronimo-annotation_1.1_spec<span
class="code-tag">&lt;/artifactId&gt;</span>
                            <span class="code-tag">&lt;version&gt;</span>1.0.1<span
class="code-tag">&lt;/version&gt;</span>
                        <span class="code-tag">&lt;/dependency&gt;</span>
                        <span class="code-tag">&lt;dependency&gt;</span>
                            <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.specs<span
class="code-tag">&lt;/groupId&gt;</span>
                            <span class="code-tag">&lt;artifactId&gt;</span>geronimo-jaxws_2.2_spec<span
class="code-tag">&lt;/artifactId&gt;</span>
                            <span class="code-tag">&lt;version&gt;</span>${geronimojaxws.version}<span
class="code-tag">&lt;/version&gt;</span>
                        <span class="code-tag">&lt;/dependency&gt;</span>
                    <span class="code-tag">&lt;/classpath&gt;</span>
                <span class="code-tag">&lt;/configuration&gt;</span>
            <span class="code-tag">&lt;/plugin&gt;</span>
            <span class="code-tag">&lt;plugin&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>org.apache.maven.plugins<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>maven-compiler-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;configuration&gt;</span>
                    <span class="code-tag">&lt;compilerArgument&gt;</span>${bootClassPath}<span
class="code-tag">&lt;/compilerArgument&gt;</span>
                <span class="code-tag">&lt;/configuration&gt;</span>
            <span class="code-tag">&lt;/plugin&gt;</span>
            <span class="code-tag">&lt;plugin&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>org.apache.maven.plugins<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>maven-surefire-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;configuration&gt;</span>
                    <span class="code-tag">&lt;argLine&gt;</span>${bootClassPath}<span
class="code-tag">&lt;/argLine&gt;</span>
                <span class="code-tag">&lt;/configuration&gt;</span>
            <span class="code-tag">&lt;/plugin&gt;</span>
...
</pre>
</div></div>

<p>Meanwhile, you can use <em>listFiles</em> options so that the <b>set</b>
property of <tt>geronimo-property-plugins</tt> could contain files or directories.
For example, if you want the <tt>geronimo-property-plugins</tt> to set "-Djava.endorsed.dirs"
property, then configure the plugin with:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;propertyValuePrefix&gt;</span>-Djava.endorsed.dirs=<span
class="code-tag">&lt;/propertyValuePrefix&gt;</span>
<span class="code-tag">&lt;listFiles&gt;</span>false<span class="code-tag">&lt;/listFiles&gt;</span>
</pre>
</div></div>
<p>If you want the plugin to set "-Xbootclasspath/p:" property configure the plugin
with:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;propertyValuePrefix&gt;</span>-Xbootclasspath/p:<span
class="code-tag">&lt;/propertyValuePrefix&gt;</span>
<span class="code-tag">&lt;listFiles&gt;</span>true<span class="code-tag">&lt;/listFiles&gt;</span>
</pre>
</div></div>


<h3><a name="BuildingApacheGeronimo-Buildcan%27tfindxbeanjar"></a>Build
can't find xbean jar</h3>
<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=166&originalVersion=165">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