<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Openfire Connection Manager Module Source Instructions</title> <link href="style.css" rel="stylesheet" type="text/css"> <style type="text/css"> .code { font-family : courier new; border : 1px #ccc solid; padding : 6px; margin : 5px 20px 5px 20px; } TT { font-family : courier new; font-weight : bold; color : #060; } PRE, CODE { font-family : courier new; font-size : 100%; } .footer { font-size : 0.8em; color : #666; text-align : center; } </style> </head> <body bgcolor="#ffffff"> <h1>Openfire Connection Manager Module Source Instructions</h1> <p> This document provides detailed information for developers that wish to compile and make changes to the connection manager source code. Use of the source code is governed by the Apache License, Version 2.0. Some of the source code in this package is Open Source software developed by third parties. Wherever this is the case, it is specifically noted in the source, and that source is governed by the license given to it by its author. <p>For additional developer resources, please visit: <a href="http://www.igniterealtime.org"> http://www.igniterealtime.org</a>. The build process is based on Ant. Visit the <a href="http://ant.apache.org/">Ant website</a> for more information. There is no need to download and install Ant - a version of it is included in this distribution. <p> This documentation is divided into three sections: <ol> <li> <a href="#source">Source</a> -- get the connection manager module source code. <li> <a href="#setup">Setup</a> -- how to setup your environment for development. <li> <a href="#tasks">Build tasks</a> -- tasks that can be performed using the build program. </ol> <p><a name="source"><b><font color="#0066cc">1.</font> Get the Connection Manager Module Source</b></a><p> You can get the source code by downloading a source distribution or by checking out the source code from SVN. Instructions for both options can be found on the <a href="http://www.igniterealtime.org/downloads/source.jsp">source page</a>. <p><a name="setup"><b><font color="#0066cc">2.</font> Setup Your Environment</b></a><p> Getting your machine ready for development requires a few steps. Wherever possible, instructions are provided for both Unix/Linux and Windows users. <p> <b><a name="javaSetup">Configure Java</a></b> <ul> Java 5 (JDK 1.5) must be installed and setup on your machine. To test the installation, open a shell in a Unix or a MS-DOS prompt in Windows. Check your version of Java with "java -version" -- it must version 1.5 or greater. If Java isn't installed, download a copy from the <a href="http://java.sun.com/">Java website</a>. <p> <font color="red">Important!</font> -- the connection manager build tool needs to know where Java is installed on your system. You must configure the "JAVA_HOME" environment variable to point to the correct directory. Instructions on how to set this variable for various platforms are as follows: <p> <ul> <li> Unix/Linux <ol> <li>Edit the ".profile" file in your home directory (or corresponding file for your shell). <li>Set the JAVA_HOME environment variable by adding the following line to the file: <p><span class="code"> export JAVA_HOME=/usr/local/jdk1.5 </span> <p> The value "/usr/local/jdk1.5" should be replaced with your actual Java directory. Be sure there are no spaces after the end of the directory name. Do not add an extra slash after the directory name. <li>Save changes to the file and then "source" it: <p><span class="code"> source .profile </span> <p> The JAVA_HOME variable should now be configured correctly. </ol> <p> <li> WindowsNT/2000/XP <ol> <li>Navigate to your desktop and right click on "My Computer"; choose properties. <li>Select the "Advanced" tab and click on the "Environment Variables" button. <li>Click the "New..." button in the System variables section. Enter the variable name "JAVA_HOME" and set the variable value to the full path of your Java installation. For example, "c:\jdk1.5". Be sure to not add an extra slash to the end of the directory name. <li>Click "OK" in all of the menus to accept the changes. <li>Close any open command prompt windows. The next time you open a command prompt, the "JAVA_HOME" variable will be set correctly. </ol> <p> <li> Windows95/98 <ol> <li>Open your autoexec.bat file (often at "c:\autoexec.bat") using Notepad. <li>Add a line to the end of the file that resembles the following: <p><span class="code"> set JAVA_HOME=c:\jdk1.5 </span> <p> The value "c:\jdk1.5" should be replaced with your actual Java directory. Be sure there are no spaces between the "=" sign or after the end of the directory name. Do not add an extra slash after the directory name. <li>Save changes to autoexec.bat and restart your computer. </ol> </ul> </ul> <p><b><a name="ant">Install the Ant Build Tool</a></b><p> The build process uses Ant, so that tool must be installed and configured on your computer. First download Ant from: <a href="http://ant.apache.org/">http://ant.apache.org</a>. Next, follow the <a href="http://ant.apache.org/manual/installlist.html">installation instructions</a>. <p><b><a name="checkout">Test the Build Script</a></b><p> <ul> Navigate into the subdirectory of this distribution named "build" via the command-line.<p> <table border="0" cellpadding="2" cellspacing="0"><td bgcolor="#EEEEEE"> <font face="verdana, arial, helvetica" size="2"> <font color="red">Linux/Unix users only:</font>You must make the ant script executable. From the build directory, type: <p></font><code> chmod u+x ant </code> </td></table> <p> Now, invoke the build tool to compile the Connection Manager source code <p> Windows:<span class="code"> ant <br> </span><br clear="left"> Unix/Linux:<span class="code"> ./ant </span> <p> If the build tool is invoked correctly and the connection manager module compiles, you've correctly configured your copy of the source distribution. </ul> <p><b>Finished!</b><p> <ul> If you've gotten this far, you've finished setting up the Openfire connection manager module source distribution. Now, read below to learn about all of the tasks that you can perform with the build tool. </ul> <br><br> <p><b><a name="tasks"><font color="#0066cc">3.</font> Build Tasks</a></b><p> The list of build tasks is below. All build commands should be run from the "build" directory of your connection manager module distribution. <br><br> For a list of the commands and a brief description from the command line, type <code>ant -projecthelp</code>. For more complete help on several commands, read the documentation below. <br><br> To execute a build task, type <code>ant [options] targetname</code> where "targetname" is one of the targets listed below: <ul> <li><a href="#noparams"><i>Default</i></a> <li><a href="#jar">jar</a> <li><a href="#clean">clean</a> </ul> <p> Each task is documented with a syntax guide and description. Optional paramaters for each task are enclosed with braces. If you would like to permanently set the value of a property, add it to build/build.xml file. <!-- default --> <p><b><a name="noparams"><i>Default</i></a></b> <ul> <i>Syntax:</i><p> <span class="code"> ant <br></span> <p><i>Description:</i></p> Equivalent of calling "ant <a href="#jar">jar</a>". <p>[<a href="#tasks">return to task list</a>] </ul> <!--JAR--> <p><b><a name="jar">jar</a></b> <ul> <i>Syntax:</i><p> <span class="code"> ant jar <br></span> <p><i>Description:</i></p> Builds the connection manager into the <tt>target</tt> directory. You can then launch module using the scripts in <tt>target/bin/</tt>. <p>[<a href="#tasks">return to task list</a>] </ul> <!--CLEAN--> <p><b><a name="clean">clean</a></b> <ul> <i>Syntax:</i><p> <span class="code"> ant clean <br></span> <p><i>Description:</i></p> Cleans all artifacts of the build process by deleting the <tt>target/</tt> directory.<p> <p>[<a href="#tasks">return to task list</a>] </ul> </body> </html>