blob: 5670ec864f89755a0d3a6122b35150d0b989f62a [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<!-- ===================================================================== -->
<!-- $Id$ -->
<!-- ===================================================================== -->
<document>
<properties>
<title>Building</title>
</properties>
<body>
<section name="Overview">
<p>
Commons Configuration can be built using
<a href="http://maven.apache.org">maven</a> or
<a href="http://ant.apache.org">ant</a>.
</p>
</section>
<section name="Maven">
<p>
Commons Configuration uses Maven as its build tool. Any recent version
of Maven should work. To build the Configuration
jar, change into the directory where the source distribution resides and run
"mvn install". This will compile the source and tests, run the tests, and then
package the jar. The jar will also be copied into the local maven repository
for use by other builds. According to the minimum Java version of
Commons Configuration, this build requires a JDK 1.6 or higher.
</p>
<p>
To build the web site run "mvn site". When it completes the web site will reside in
the target/site directory and may be viewed by opening target/site/index.html.
</p>
</section>
<section name="Running Functional Tests">
<p>
<code>TestWebdavConfigurationBuilder</code> is a functional test that tests
DefaultConfigurationBuilder with the configuration files stored in a WebDAV
server. To run the test the steps that follow
<ol>
<li>Copy all the files in the conf directory to the WebDAV server. Not all the
files are required but it is generally easier to use a tool like cadaver
and do an mput than try to copy the required files individually.</li>
<li>Add the following to the profiles section of settings.xml in the Maven home
directory. Modify the urls to match your setup.
<source><![CDATA[
<profile>
<profile>
<id>webdav</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<test.webdav.base>webdav://vfsusr:vfstest@192.168.10.133:80/conf</test.webdav.base>
</properties>
</profile>]]></source></li>
<li>run "mvn -P webdav test -Dtest=TestWebdavConfigurationBuilder". The test
can also be run using "mvn -P webdav test" but this will run all the unit tests
in addition to the WebDAV test.</li>
</ol>
</p>
</section>
<section name="Building with Ant">
<p>
In order to build the project with Apache Ant, some manual preparations
have to be done. The problem is that Commons Configuration uses
classes generated by <a href="http://javacc.java.net/">JavaCC</a>
to process configuration files in specific formats. These classes
are produced dynamically during the build process. While Maven is
able to download all required artifacts automatically, the Ant build
is not that smart. Therefore, it is required to download and install
JavaCC manually. Then a file named <code>build.properties</code> has
to be created in the root directory of Commons Configuration which
defines the <em>javacc_home</em> property; here the path to the
JavaCC installation has to be set. Commons Configuration already
ships with a <code>build.properties.sample</code> file which can be
copied and adapted correspondingly.
</p>
<p>
After these preparations have been done, the following Ant goals
can be used:
<ul>
<li>To build a jar file, change into Configuration's root directory
and run "ant jar". The result will be in the "target" subdirectory.
</li>
<li>To build the Javadocs, run "ant javadoc". The result will be
in "target/site/apidocs".</li>
</ul>
</p>
</section>
</body>
</document>