<?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>Maven First Steps</title>
    <subtitle>Custom Project First Steps</subtitle>
	<authors>
		<person name="David Sean Taylor" email="taylor@apache.org" />
	</authors>
  </properties>
  <body>
    <section name="First Steps with Maven-2">
    <p>
    Minimal configuration is required to get started with your Jetspeed custom build and Maven-2.
    </p>
    <subsection name='Copying in the settings.xml'>
      <p>      
       The first step to building with Maven-2 is to setup your <b>settings.xml</b>.
       These settings hold all the information necessary to build with Maven-2 and Jetspeed.             
      </p>
      <p>There is a <i>settings.xml.jetexpress</i> file in the <i>/JetspeedTraining/resources/maven/</i> directory.
         Copy this file into your <i>Maven Home</i> directory. The Maven home directory
         is located in a directory named <b>.m2</b> found under your <i>User Home</i> directory.
         So for example that would be <i>~/.m2/</i> on Linux, or <i>"%USERPROFILE%\.m2\"</i> on Windows.
      </p>
	  <p>
	  <b>Linux: paste into Command Line:</b>
	  <input size ='80' value='mkdir ~/.m2'/>
	  <input id='cl1' size="80" value="cp resources/maven/settings.xml.jetexpress ~/.m2/settings.xml"/>	  
	  </p>
	  <p>
	  <b>Windows: paste into Command Line:</b>
	  <input size="80" value='mkdir "%USERPROFILE%\.m2"'/>
	  <input id='cl1' size="80" value='copy resources\maven\settings.xml.jetexpress "%USERPROFILE%\.m2\settings.xml"'/>	  	  	  
	  </p>	  
	</subsection>
    <subsection name='Editing the settings.xml'>	
      <p>
      The settings file is primarily for configuring your application server and database.
      The settings are preconfigured for an embedded Derby database, so more changes are required 
      if another database solution is to be used, covered later in this tutorial.      
      </p>
	  <p>	 
	  Edit the <i>~/.m2/settings.xml</i> file. 
	  </p>
	</subsection>
    <subsection name='Change the Jetspeed Server (Tomcat) Location'>		  
    <p>
	  For the purpose of the training, lets all use the same Tomcat home, point it to the <i>/JetspeedTraining/tomcat-express</i> directory.
	  </p>
	 <source>
	 <![CDATA[		
	  <org.apache.jetspeed.server.home>c:/JetspeedTraining/tomcat-express</org.apache.jetspeed.server.home>
     ]]>
	</source> 
	</subsection>
    <subsection name='Change the Derby Database location'>		  	
	  <p>	 
	  Next, lets change the location of our Derby database to the <i>/JetspeedTraining/database/jetexpress</i> directory.
	  </p>
	 <source>
	 <![CDATA[		
     <org.apache.jetspeed.production.database.url>jdbc:derby:/JetspeedTraining/database/jetexpress</org.apache.jetspeed.production.database.url>	 
     ]]>
	</source> 	
	</subsection>
    <subsection name='Change the Repository Location'>		
    <p>  
        Change the Maven local repository location by modifying the <i>&lt;localRepository&gt;</i>
	    element in the settings.xml file. If you are using the training material, we have pre-configured
	    a Maven-2 repository /JetspeedTraining/maven/repository. Lets configure Maven to point there,
	    edit the <i>settings.xml</i>:	    
     </p>
	 <source>
	 <![CDATA[		
	  <localRepository>c:/JetspeedTraining/maven/repository/</localRepository>
     ]]>
	</source> 
	  <p>Go on and save that file.</p>     
	</subsection>
	  <p>
	    <a href='genapp.html'>Next</a>
	  </p>            	  
    </section>        
  </body>
</document>

