Project

General

Profile

1
<!--
2
  * sitemaps.html
3
  *
4
  *      Authors: Michael Daigle
5
  *    Copyright: 2008 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *      Created: 2008 November 4
9
  *      Version: 
10
  *    File Info: '$ '
11
  * 
12
  * 
13
-->
14
<HTML>
15
<HEAD>
16
<TITLE>Building Metacat</TITLE>
17
<!-- unfortunately, we have to look for the common css file in the 
18
     user docs directory.  This is because the user docs deploy to 
19
     the top level of the metacat docs on the knb web server -->
20
<link rel="stylesheet" type="text/css" href="../user/common.css">
21
<link rel="stylesheet" type="text/css" href="./default.css">
22
</HEAD> 
23
<BODY>
24
  <table width="100%">
25
    <tr>
26
      <td class="tablehead" colspan="2"><p class="label">Building Metacat</p></td>
27
      <td class="tablehead" colspan="2" align="right">
28
        <a href="./metacat-eclipse-project.html">Back</a> | <a href="./index.html">Home</a> | 
29
        <!--a href="add next file here when one exists" -->Next<!-- /a -->
30
      </td>
31
    </tr>
32
  </table>
33
      
34
  <div class="header1">Table of Contents</div>
35
  <div class="toc">
36
    <div class="toc1"><a href="#Intro">About Building Metacat</a></div>
37
    <div class="toc1"><a href="#Prep">Prep the Build Configuration</a></div>
38
      <div class="toc2"><a href="#BuildProperties">build.properties</a></div>
39
      <div class="toc2"><a href="#BuildXml">build.xml</a></div>
40
    <div class="toc1"><a href="#Cleaning">Cleaning the Codebase</a></div>
41
    <div class="toc1"><a href="#AutomatedBuild">Automated Build</a></div>
42
    <div class="toc1"><a href="#ManualBuild">Manual Build</a></div>
43
  </div>  
44
  
45
  <a name="Intro"></a><div class="header1">About Building Metacat</div>
46
  <p>This documentation covers building Metacat on a local development environment. 
47
  In essence, the local development build is no different than the production build,
48
  but a few convenience options have been added to help the developer. </p>  
49
  
50
  <p>These instructions are meant to augment the Install Metacat War section of the
51
  <a href="../user/metacat-install.html">Metacat Installation Guide</a>.</p>
52
  
53
  <p>Metacat is built using the Ant build utility.  You will need to have Ant
54
  installed on your development system to build Metacat</p>
55
  
56
  <a name="Prep"></a><div class="header1">Prep the Build Configuration</div>
57
  <a name="BuildProperties"></a><div class="header2">build.properties</div>
58
  <p>You will need to edit <metacat_workspace>/build.properties and make sure
59
  the following values are correct:
60
  <ul>
61
  <li>build.tomcat.dir - Metacat will look for some HttpServlet libraries in the local
62
  Tomcat directories.  Make sure this value is set to your local Tomcat installation 
63
  directory.</li>
64
  <li>dev.deploy.dir - the automated development build (dev-install) will deploy your
65
  war file for you and clean up old application directories.  Make sure this is set
66
  to the directory where Tomcat looks for its applications.</li>
67
  </ul>
68
  
69
  <a name="BuildXml"></a><div class="header2">build.xml</div>
70
  <p>There are several adjustments you can make to the build by editing 
71
  &gt;metacat_workspace&lt;/build.xml.  Some of the common ones are:
72
  <ul>
73
  <li>eml2_1_0-schema-tag - the tag in the eml repository that Metacat will use to
74
  check out EML schema code.  You would change this if you want to check out the latest code 
75
  on the head (leave as "") or if you want to run against an older version.</li>
76
  <li>eml2_1_0-style-tag - the tag in the eml repository that Metacat will use to
77
  check out EML style code.  You would change this if you want to check out the latest code 
78
  on the head (leave as "") or if you want to run against an older version.</li>
79
  <li>util-module - this tells metacat where to checkout to and/or look for 
80
  the common utilities code.  Typically this is in a directory named utilities at the 
81
  same level as Metacat code.  You could change this to point to an alternative directory
82
  which may have different utilities code (from a different branch for instance).</li>
83
  <li>utilities-tag - the tag in the utility repository that Metacat will use to
84
  check out utility code.  You would change this if you want to check out the latest code 
85
  on the head (leave as "") or if you want to run against an older version.</li>
86
  </ul>
87

    
88
  <a name="Cleaning"></a><div class="header1">Cleaning the Codebase</div>
89
  <p>The metacat build.xml has several methods for cleaning the codebase.  The format
90
  for running these is:</p>
91
  <div class="code">ant &lt;clean-target&gt;</div>
92
  The available clean-targets are:
93
  <ul>
94
  <li>clean - removes build and dist dirs.  This will cause a rebuild of code in the 
95
  metacat project.</li>
96
  <li>localclean - does a clean plus removes utilities and httpclient jars.  This 
97
  causes a rebuild of utilities and the metacat project.  This is provided so the 
98
  developer does not need to download all eml files every time utilities change.</li>
99
  <li>ant fullclean - do a localclean plus remove eml files, so the system will 
100
  checkout eml files from the eml module in CVS.</li>
101
  </ul>
102
  
103
  <a name="AutomatedBuild"></a><div class="header1">Automated Build</div>
104
  <p>There is an ant target called "dev-install" that was created specifically for
105
  local develoment building and deploying.  What it does is:
106
  <ul>
107
  <li>Builds the Metacat project, resulting in a war file.</li>
108
  <li>Moves the war file to the dev.deploy.dir that you set in build.properties</li>
109
  <li>Removes the existing application directory from the dev.deploy.dir.</li>
110
  </ul>
111
  Typical usage would be something like:</p>
112
  <div class="code">ant fullclean dev-install</div>
113
  
114
  <a name="ManualBuild"></a><div class="header1">Manual Build</div>  
115
  <p>You can also build the Metacat war file and deploy manually.  To build and create the 
116
  war, run:</p>
117
  <div class="code">ant build-metacat</div> 
118
  <p>The war file will appear in your &gt;metacat_workspace&lt;/dist directory.  Copy the war
119
  file into your tomcat webapps directory.  Delete the existing code that was expanded
120
  from the old jar.</p>
121
</BODY>
122
</HTML>
(3-3/31)