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
  following guides
52
  <ul>
53
  <li><a href="../user/metacat-linux-install.html">Metacat Linux Installation Guide</a>.</li>
54
  <li><a href="../user/metacat-windows-install.html">Metacat Windows Installation Guide</a>.</li>
55
  </ul>
56
  
57
  <p>Metacat is built using the Ant build utility.  You will need to have Ant
58
  installed on your development system to build Metacat</p>
59
  
60
  <a name="Prep"></a><div class="header1">Prep the Build Configuration</div>
61
  <a name="BuildProperties"></a><div class="header2">build.properties</div>
62
  <p>You will need to edit <metacat_workspace>/build.properties and make sure
63
  the following values are correct:
64
  <ul>
65
  <li>build.tomcat.dir - Metacat will look for some HttpServlet libraries in the local
66
  Tomcat directories.  Make sure this value is set to your local Tomcat installation 
67
  directory.</li>
68
  <li>dev.deploy.dir - the automated development build (dev-install) will deploy your
69
  war file for you and clean up old application directories.  Make sure this is set
70
  to the directory where Tomcat looks for its applications.</li>
71
  </ul>
72
  
73
  <a name="BuildXml"></a><div class="header2">build.xml</div>
74
  <p>There are several adjustments you can make to the build by editing 
75
  &gt;metacat_workspace&lt;/build.xml.  Some of the common ones are:
76
  <ul>
77
  <li>eml2_1_0-schema-tag - the tag in the eml repository that Metacat will use to
78
  check out EML schema code.  You would change this if you want to check out the latest code 
79
  on the head (leave as "") or if you want to run against an older version.</li>
80
  <li>eml2_1_0-style-tag - the tag in the eml repository that Metacat will use to
81
  check out EML style code.  You would change this if you want to check out the latest code 
82
  on the head (leave as "") or if you want to run against an older version.</li>
83
  <li>util-module - this tells metacat where to checkout to and/or look for 
84
  the common utilities code.  Typically this is in a directory named utilities at the 
85
  same level as Metacat code.  You could change this to point to an alternative directory
86
  which may have different utilities code (from a different branch for instance).</li>
87
  <li>utilities-tag - the tag in the utility repository that Metacat will use to
88
  check out utility code.  You would change this if you want to check out the latest code 
89
  on the head (leave as "") or if you want to run against an older version.</li>
90
  </ul>
91

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