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

<document>

  <properties>
    <title>Developer's Guide</title>
    <author email="jvanzyl@apache.org">Jason van Zyl</author>
    <author email="jmcnally@collab.net">John McNally</author>
    <author email="mpoeschl@marmot.at">Martin Poeschl</author>
    <author email="seade@backstagetech.com.au">Scott Eade</author>
  </properties>

  <body>


    <section name="Building from SVN">
      <p>
        The Torque build process uses
        <a href="http://maven.apache.org/maven1">Maven 1</a>.  The recommended
        Maven version is Maven 1.0.2. A rudimentary
        <a href="http://maven.apache.org">Maven 2</a> build exists (see below),
        but is only used to build the Maven 2 plugin.
        <br/>
        Note that the Maven 1 build uses the groupId <code>torque</code>, 
        wheras the Maven 2 build uses the group id 
        <code>org.apache.db.torque</code>.
      </p>
      <p>
        Before you begin, you'll need to check out the <code>trunks</code> 
        part of the <code>db/torque</code> SVN repository.
        Please read the <a href="subversion.html">Torque Subversion</a> page
        for more information.
      </p>
      
      <subsection name="Maven 1 build">
        <p>
          To build the Torque generator jar, first execute
          <code>maven jar:install</code> in the
          <code>templates</code> directory to install a copy
          of the templates jar in your local Maven repository. Note that
          <code>maven jar:jar</code> does not suffice because the
          main generator jar depends upon the template jar.
          Afterwards, execute <code>maven jar:jar</code> in the generator
          directory to build the generator jar (<code>maven jar:install</code>
          to install a copy of the jar in your local Maven repository).
        </p>
        <p>
          To build and install the Torque Maven 1 plugin, execute <code>maven
          plugin:install</code> in the <code>maven-plugin</code> directory.
          You need to have the generator installed in your local repository
          to do that (see paragraph above).
        </p>
        <p>
          To build the Torque runtime jar execute <code>maven jar:jar</code> in
          the <code>runtime</code> directory 
          (<code>maven jar:install</code> to install a copy of the jar 
          in your local Maven repository).
        </p>
        <p>
          If you need everything at once, run <code>maven install</code> in the
          top level directory. This will perform all the steps described above and
          place the results into your local maven repository.
        </p>
        <p>
          The Torque Maven 2 plugin cannot be built using Maven 1.
        </p>
      </subsection>
      
      <subsection name="Maven 2 build">
        <p>
          Change into the directories common, village, runtime, templates, generator, and
          maven2-plugin in this order and run <code>mvn install</code>
          in each of them.
        </p>
        <p>
          The Torque Maven 1 plugin cannot be built using Maven 2.
        </p>
      </subsection>
    </section>

    <section name="Testing">
     <p>
        Torque is tested by running the test project.  Please refer to the
        <a href="test-project.html">Test Project docs</a> for information.
      </p>
    </section>

  </body>
</document>
