<!--
  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p>[<a
href="http://dist.wso2.org/products/wsas/java/@wso2wsas_version@">Download</a>]
| [<a href="index_docs.html">Documentation Home</a>] | [<a
href="release_notes.html">Release Note</a>]</p>
<h1>Source Distribution</h1>

<p>This page of the installation guide explains how to build the WSO2 WSAS
using the source distribution of the release.</p>
<a name="intro"></a>

<h2>Introduction</h2>

<p>WSO2 WSAS is available as a extractable binary or an installable package.
The <a href="installation_guide.html">Installation Guide</a> contain
instructions on the installation of these distributions.)</p>

<p>For the more adventurous user, this release provides a source distribution
so that they can build the WSO2 WSAS from the source.</p>

<p><a
href="http://dist.wso2.org/products/wsas/java/@wso2wsas_version@"><strong>Download</strong></a>
WSO2 WSAS Source Distribution: wso2wsas-@wso2wsas_version@-src.zip</p>
<a name="req"></a>

<h2>System Requirements</h2>

<table border="2">
  <caption></caption>
  <tbody>
    <tr>
      <td>Java Runtime Environment</td>
      <td>1.4 or 1.5 (For instructions on setting up the JRE in different
        operating systems, visit <a
        href="http://java.sun.com">http://java.sun.com</a>)</td>
    </tr>
    <tr>
      <td><strong>Maven</strong></td>
      <td>2.0.6 or higher (2.0.7 recommended) in Maven 2.x series (<a
        href="http://maven.apache.org/">download</a>). <strong>Please
        download maven 2.x version.</strong></td>
    </tr>
    <tr>
      <td>Operating System</td>
      <td>Tested on Windows XP, Linux(Fedora core, Ubuntu and Gentoo), Mac OS X &amp; Sun Solaris</td>
    </tr>
  </tbody>
</table>

<a name="env"></a>

<h2>Setting Up the Environment and Tools</h2>

<h3>Maven:</h3>

<p>The WSO2 WSAS build is based on <a
href="http://maven.apache.org/maven-2.x/">Maven</a>. Hence, a prerequisite to
build WSO2 WSAS from the source distribution is to have Maven and JDK
installed. Extensive instructions are available on the Maven site.</p>

<p>This guide however contains the easiest path for quick environment
setting. Advanced users can <a
href="http://maven.apache.org/start/index.html">learn more about
Maven</a>.</p>
<ul>
  <li>MS Windows</li>
</ul>
<ol>
  <li>Download and run the Windows installer package</li>
  <li>Set the 'Environment Variables' (create the system variable M2_HOME and
    edit the path. e.g., "set M2_HOME=C:\Program Files\Apache Software
    Foundation\maven-2.0.x"; set path=%path%;%M2_HOME%\bin)</li>
  <li>Make sure that the system variable <a
    href="setting_java_home.html">JAVA_HOME</a> is set to the location of
    your JDK, e.g., C:\Program Files\Java\jdk1.5.0_02</li>
  <li>Run 'mvn --version' to verify that it is correctly installed.</li>
</ol>
<ul>
  <li>Unix based OS (Linux etc)</li>
</ul>

<p>The tar ball or the zip archive is the best option. Once the archive is
downloaded, expand it to a directory of choice and set the environment
variable M2_HOME and add M2_HOME/bin to the path as well. You can also refer
to more instructions on <a href="http://maven.apache.org/download.html">how
to install Maven in Unix</a> based operating systems.</p>

<p>Once Maven is properly installed, you can start building the WSO2 WSAS for
Java.</p>
<a name="build"></a>

<h2>Building WSO2 WSAS from the Source Distribution</h2>

<p>The <a
href="http://dist.wso2.org/products/wsas/java/@wso2wsas_version@">source
distribution</a> is available as a zipped archive. All the necessary build
scripts are included with the source distribution. Expand the source archive
to a directory of your choice. You can run the following commands inside that
directory to build the WSO2 WSAS.</p>

<p><strong>The list of commands that can be run are as follows:</strong></p>

<p><strong>Note:</strong> The first time you run Maven, it will automatically
download the dependent .jars. Therefore, the first run will take more
time. The third party libraries required by WSO2 WSAS will be downloaded from the
Maven2 repositories specified in the main pom.xml file.</p>

<table border="1">
  <caption></caption>
  <tbody>
    <tr>
      <td><strong>mvn clean install</strong></td>
      <td>To create the complete release artifacts including the binary and
        source distributions.</td>
    </tr>
    <tr>
      <td><strong>mvn clean install -Dtest=false</strong></td>
      <td>To create the complete release artifacts including the binary and
        source distributions, without running any of the unit tests.</td>
    </tr>
    <tr>
      <td><strong>mvn clean install -Dtest=false -o</strong></td>
      <td>To create the complete release artifacts including the binary and
        source distributions, without running any of the unit tests, in offline mode.</td>
    </tr>
      <tr>
      <td><strong>mvn clean install site</strong></td>
      <td>Will also generate the project site and all the reports of the analysis tools
          integrated with WSAS such as Findbugs, Checkstyle etc. The index file will be generated in
          the target/site directory.</td>
    </tr>
  </tbody>
</table>

<p>All the sources of the major 3rd party components included in WSO2 WSAS can be found in
the <strong>third-party</strong> folder included in the source distribution. For the purpose
of debugging applications, you could attach these sources.</p>

<hr/>
</body>
</html>
