directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Directory Server v1.5 > 0.2. Building trunks
Date Tue, 19 Apr 2011 17:28:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=DIRxSRVx11&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/DIRxSRVx11/0.2.+Building+trunks">0.2.
Building trunks</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~elecharny">Emmanuel
L├ęcharny</a>
    </h4>
        <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" >{code} <br>cd apacheds-trunk
<br></td></tr>
            <tr><td class="diff-changed-lines" >mvn <span class="diff-added-words"style="background-color:
#dfd;">-Pinstallers</span> install <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">cd
installers/apacheds <br>mvn -Pserver-installer install <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/DIRxSRVx11/0.1.+Reporting+Bugs"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/DIRxSRVx11/0.1.+Reporting+Bugs">0.1.
Reporting Bugs</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/DIRxSRVx11/0.+Community"><img border='0' align='middle' src='/confluence/images/icons/up_16.gif'
width='8' height='8'></a></sup><a href="/confluence/display/DIRxSRVx11/0.+Community">0.
Community</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a
href="/confluence/display/DIRxSRVx11/0.3.+Contributing">0.3. Contributing</a></td><td
class='ScrollbarNextIcon'><a href="/confluence/display/DIRxSRVx11/0.3.+Contributing"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
<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><b>Work in progress</b><br
/>This site is in the process of being reviewed and updated.</td></tr></table></div>
<p>This page give some information about the layout of <b>Apache DS 1.5</b>
trunks, and try to explain how it is built.</p>

<div>
<ul>
    <li><a href='#0.2.Buildingtrunks-ProjectHierarchy'>Project Hierarchy</a></li>
    <li><a href='#0.2.Buildingtrunks-Prerequisitesforbuilding'>Prerequisites for
building</a></li>
<ul>
    <li><a href='#0.2.Buildingtrunks-Maven'>Maven</a></li>
    <li><a href='#0.2.Buildingtrunks-JDK5'>JDK 5</a></li>
</ul>
    <li><a href='#0.2.Buildingtrunks-Gettingthecode'>Getting the code</a></li>
    <li><a href='#0.2.Buildingtrunks-Buildingthetrunks'>Building the trunks</a></li>
<ul>
    <li><a href='#0.2.Buildingtrunks-EnablingSnapshotRepositories'>Enabling Snapshot
Repositories</a></li>
    <li><a href='#0.2.Buildingtrunks-%26nbsp%3BBuildingthetrunks'>&nbsp;Building
the <b>trunks</b></a></li>
</ul>
    <li><a href='#0.2.Buildingtrunks-Buildingtheinstallers'>Building the installers</a></li>
    <li><a href='#0.2.Buildingtrunks-Startingtheserverwithoutinstallation'>Starting
the server without installation</a></li>
    <li><a href='#0.2.Buildingtrunks-Integrationtest'>Integration test</a></li>
    <li><a href='#0.2.Buildingtrunks-Eclipse'>Eclipse</a></li>
<ul>
    <li><a href='#0.2.Buildingtrunks-Buildingeclipsefiles'>Building eclipse files</a></li>
    <li><a href='#0.2.Buildingtrunks-Mavensettings'>Maven settings</a></li>
    <li><a href='#0.2.Buildingtrunks-Eclipsehints'>Eclipse hints</a></li>
    <li><a href='#0.2.Buildingtrunks-Eclipseplugins'>Eclipse plugins</a></li>
    <li><a href='#0.2.Buildingtrunks-Codingstandards'>Coding standards</a></li>
</ul>
</ul></div>

<h2><a name="0.2.Buildingtrunks-ProjectHierarchy"></a>Project Hierarchy</h2>

<p>The actual project hierarchy is the following (as of 1.5.5-SNAPSHOT) :</p>
<ul>
	<li>apacheds
	<ul>
		<li>bootstrap-extract</li>
		<li>bootstrap-partition</li>
		<li>bootstrap-plugin</li>
		<li>btree-base</li>
		<li>core</li>
		<li>core-avl</li>
		<li>core-constants</li>
		<li>core-entry</li>
		<li>core-integ</li>
		<li>core-jndi</li>
		<li>core-plugin</li>
		<li>core-shared</li>
		<li>core-unit</li>
		<li>interceptor-kerberos</li>
		<li>jdbm</li>
		<li>jdbm-store</li>
		<li>kerberos-shared</li>
		<li>ldap-api-test</li>
		<li>protocol-changepw</li>
		<li>protocol-dhcp</li>
		<li>protocol-dns</li>
		<li>protocol-kerberos</li>
		<li>protocol-ldap</li>
		<li>protocol-ntp</li>
		<li>protocol-shared</li>
		<li>schema-bootstrap</li>
		<li>schema-extras</li>
		<li>schema-registries</li>
		<li>server-integ</li>
		<li>server-jndi</li>
		<li>server-replication</li>
		<li>server-tools</li>
		<li>server-unit</li>
		<li>server-xml</li>
		<li>syncrepl</li>
		<li>utils</li>
		<li>xbean-spring</li>
		<li>xdbm-base</li>
		<li>xdbm-search</li>
		<li>xdbm-tools</li>
	</ul>
	</li>
</ul>


<ul>
	<li>shared
	<ul>
		<li>asn1</li>
		<li>asn1-codec</li>
		<li>client-api</li>
		<li>convert</li>
		<li>cursor</li>
		<li>ldap</li>
		<li>ldap-constants</li>
		<li>ldap-jndi</li>
	</ul>
	</li>
</ul>


<ul>
	<li>daemon
	<ul>
		<li>bootstrappers</li>
		<li>plugin</li>
	</ul>
	</li>
</ul>


<blockquote>
<p> This hierarchy represent the projects being built.</p></blockquote>

<h2><a name="0.2.Buildingtrunks-Prerequisitesforbuilding"></a>Prerequisites
for building</h2>

<p>You must have installed <b>Maven 2.0.9</b> and have a <b>JDK 5</b>
installed on your computer. A working internet connection is also mandatory.</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>If the build hangs or you get
an out of memory exception please increase the heap space:

<ul>
	<li>For Linux:</li>
</ul>


<p>      MAVEN_OPTS="-Xmx256m" mvn clean install</p>

<ul>
	<li>For Windows:</li>
</ul>


<p>      SET MAVEN_OPTS="-Xmx256m"<br/>
      mvn clean install</p></td></tr></table></div>

<h3><a name="0.2.Buildingtrunks-Maven"></a>Maven</h3>

<p><a href="http://maven.apache.org/download.html" class="external-link" rel="nofollow">Download</a>
and install Maven 2.0.9. (ATTENTION &#33;&#33;&#33; Do NOT use an older version
of Maven )</p>

<p>Add a MAVEN_HOME environment variable and add MAVEN_HOME/bin to your system path:</p>

<p>On a Linux box you could add the following to the .bashrc file  (.bashrc is a file
you'll find in your home directory)</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>...
export MAVEN_HOME=/opt/maven-2.0.9
export PATH=$JAVA_HOME:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
...
</pre>
</div></div>
<p>Windows users, use Control Panel &#45;&gt; System &#45;&gt; Advanced
&#45;&gt; Environment Variables</p>

<h3><a name="0.2.Buildingtrunks-JDK5"></a>JDK 5</h3>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Sun JDK</b><br
/>There may be some issues with older JDK versions and Kerberos, therefore we recommend
using a version &gt;=1.5.0_09</td></tr></table></div>


<h2><a name="0.2.Buildingtrunks-Gettingthecode"></a>Getting the code</h2>

<p>To download the sources, you must have installed a <b>Subversion</b>
client.</p>

<p>With readonly access :</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>svn co http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/
apacheds-trunk
</pre>
</div></div>
<p>With read/write access (for committers only) :</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>svn co https://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/
apacheds-trunk
</pre>
</div></div>

<h2><a name="0.2.Buildingtrunks-Buildingthetrunks"></a>Building the trunks</h2>


<h3><a name="0.2.Buildingtrunks-EnablingSnapshotRepositories"></a>Enabling
Snapshot Repositories</h3>

<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 information is only
needed if one want to setup its own maven repo. There is no need to define a settings.xml
file for generic usage. <br/>
Before building the trunks, you must configure Maven 2 to use the snapshot repository for
Apache.  Snapshot repositories are typically configured per user at &#126;/.m2/settings.xml.
 The following example, added to your settings.xml, will add a profile for the Apache snapshot
repository.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;settings&gt;
  &lt;profiles&gt;
    ...
    &lt;profile&gt;
      &lt;id&gt;apache&lt;/id&gt;
      &lt;repositories&gt;
        &lt;repository&gt;
          &lt;id&gt;apache.org&lt;/id&gt;
          &lt;name&gt;Maven Snapshots&lt;/name&gt;
          &lt;url&gt;http:<span class="code-comment">//people.apache.org/repo/m2-snapshot-repository&lt;/url&gt;
</span>          &lt;releases&gt;
            &lt;enabled&gt;<span class="code-keyword">false</span>&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;<span class="code-keyword">true</span>&lt;/enabled&gt;
          &lt;/snapshots&gt;
        &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;pluginRepositories&gt;
        &lt;pluginRepository&gt;
          &lt;id&gt;apache.org&lt;/id&gt;
          &lt;name&gt;Maven Plugin Snapshots&lt;/name&gt;
          &lt;url&gt;http:<span class="code-comment">//people.apache.org/repo/m2-snapshot-repository&lt;/url&gt;
</span>          &lt;releases&gt;
            &lt;enabled&gt;<span class="code-keyword">false</span>&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;<span class="code-keyword">true</span>&lt;/enabled&gt;
          &lt;/snapshots&gt;
        &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
    &lt;/profile&gt;
    ...
  &lt;/profiles&gt;
&lt;/settings&gt;
</pre>
</div></div></td></tr></table></div>

<p>You may either specify the profile at the command-line, each time you use 'mvn',
or you may configure the profile to always be active.</p>

<p>To use a profile at the command-line:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
# mvn -Papache [options] [&lt;goal(s)&gt;] [&lt;phase(s)&gt;]
</pre>
</div></div>
<p>To specify the 'apache' profile to always be active:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;settings&gt;
  ...
  &lt;activeProfiles&gt;
    &lt;activeProfile&gt;apache&lt;/activeProfile&gt;
  &lt;/activeProfiles&gt;
  ...
&lt;/settings&gt;
</pre>
</div></div>

<h3><a name="0.2.Buildingtrunks-%26nbsp%3BBuildingthetrunks"></a>&nbsp;Building
the <b>trunks</b></h3>

<p>Now, we can compile the project.</p>

<p>The command is simple :</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd apacheds-trunk
mvn clean install
</pre>
</div></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>Issue Commands
From Top</b><br />You must make sure you build the shared, installers, and daemon
project modules in addition to the apacheds module to prevent problems with stale Maven SNAPSHOT
jars in the snapshot repository from causing compilation errors. This can be guaranteed by
performing all Maven operations above in the top directory that you checked out: the apacheds-trunk
directory.</td></tr></table></div>

<p>A lot of plugins will be downloaded. If you are curious, you can then look at .m2/repository
to see what has been downloaded on this step.<br/>
Building should finish with these lines:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 minutes 30 seconds
[INFO] Finished at: Mon Oct 30 23:32:41 CET 2006
[INFO] Final Memory: 18M/32M
[INFO] ------------------------------------------------------------------------
</pre>
</div></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td>If you want to do
really safe build, run the following commands in trunks:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>resources/superclean.sh
mvn install -Dintegration
</pre>
</div></div></td></tr></table></div>

<h2><a name="0.2.Buildingtrunks-Buildingtheinstallers"></a>Building the
installers</h2>

<p>Building the installers is a two phase process :</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd apacheds-trunk
mvn -Pinstallers install
</pre>
</div></div>

<p>That's it, the jars will be find in target/images/apacheds-1.5.?<del>SNAPSHOT</del>&lt;XXXXXX&gt;-setup.jar
where XXXXXX is your local system and ? is the feature release minor number for the 1.5 branch.</p>

<h2><a name="0.2.Buildingtrunks-Startingtheserverwithoutinstallation"></a>Starting
the server without installation</h2>

<p>The directory apacheds-trunk/installers/apacheds-noarch contains a script for Linux
(apacheds.sh) and one for Windows (apacheds.bat) which can be used for starting the server
without the need to install it first (as non-root-user on Linux and non-Windows-service on
Windows).</p>

<p>Linux:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>cd apacheds-trunk/installers/apacheds-noarch
./apacheds.sh
</pre>
</div></div>

<h2><a name="0.2.Buildingtrunks-Integrationtest"></a>Integration test</h2>

<p>To run integration tests, just use the following command :</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd apacheds-trunk
mvn -Dintegration test
</pre>
</div></div>

<h2><a name="0.2.Buildingtrunks-Eclipse"></a>Eclipse</h2>


<h3><a name="0.2.Buildingtrunks-Buildingeclipsefiles"></a>Building eclipse
files</h3>

<p>To build the .project and .classpath files for eclipse, type the following commands
:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd apacheds-trunk
mvn clean install
mvn eclipse:eclipse
cd apacheds/bootstrap-partition
mvn clean install
</pre>
</div></div>

<p>(The last command is necessary because eclipse:eclipse purge the target directory,
and we need some generated files which has been removed. This is why we do another *mvn clean
install├╣ in the boostrap-partition module<br/>
then import all the existing project which has been created.</p>

<h3><a name="0.2.Buildingtrunks-Mavensettings"></a>Maven settings</h3>

<p>Don't forget to declare a classpath variable named M2_REPO, pointing to &#126;/.m2/repository,
otherwise many links to existing jars will be broken.<br/>
You can declare new variables in Eclipse in <em>Windows &#45;&gt; Preferences...</em>
and selecting <em>Java &#45;&gt; Build Path &#45;&gt; Classpath Variables</em></p>

<h3><a name="0.2.Buildingtrunks-Eclipsehints"></a>Eclipse hints</h3>

<p>Add an eclipse-apacheDS.sh file in your eclipse root directory, to allow eclipse
to get more memory (e.g. 750MB)<br/>
You may also declare a specific workspace when launching eclipse. I have created a workspace-apacheDS
directory in my HOME directory, where all the ApacheDS project is built when I use Eclipse.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>&lt;eclipse_root&gt;/eclipse -data $HOME/workspace-apacheDS -vm java -vmargs
-Xmx750M
</pre>
</div></div>
<p>Launch eclipse :</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>&lt;eclipse_root&gt;/eclipse-apacheDS.sh
</pre>
</div></div>

<h3><a name="0.2.Buildingtrunks-Eclipseplugins"></a>Eclipse plugins</h3>


<h3><a name="0.2.Buildingtrunks-Codingstandards"></a>Coding standards</h3>

<p>The coding standards including an eclipse code formatting profile is available <a
href="/confluence/display/DIRxDEV/Coding+standards" title="Coding standards">here</a>.</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/DIRxSRVx11/0.2.+Building+trunks">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=28589&revisedVersion=39&originalVersion=38">View
Changes</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message