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="./testing-metacat.html">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>app.deploy.dir - the automated installation build (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
  <li>cvsroot - if your cvs user is different than the user you are using to build metacat, 
72
  you will need to change
73
    <div class="code">:ext:${env.USER}@cvs.ecoinformatics.org:/cvs</div>
74
  to
75
    <div class="code">:ext:&lt;your_cvs_user&gt;@cvs.ecoinformatics.org:/cvs</div>
76
  If you do not have a personal account with cvs, you can set the username to 
77
  "anonymous".  The password will be "guestaccess".
78
  </li>
79
  </ul>
80
  
81
  <a name="BuildXml"></a><div class="header2">build.xml</div>
82
  <p>There are several adjustments you can make to the build by editing 
83
  &gt;metacat_workspace&lt;/build.xml.  Some of the common ones are:
84
  <ul>
85
  <li>eml2_1_0-schema-tag - the tag in the eml repository that Metacat will use to
86
  check out EML schema code.  You would change this if you want to check out the latest code 
87
  on the head (leave as "") or if you want to run against an older version.</li>
88
  <li>eml2_1_0-style-tag - the tag in the eml repository that Metacat will use to
89
  check out EML style code.  You would change this if you want to check out the latest code 
90
  on the head (leave as "") or if you want to run against an older version.</li>
91
  <li>util-module - this tells metacat where to checkout to and/or look for 
92
  the common utilities code.  Typically this is in a directory named utilities at the 
93
  same level as Metacat code.  You could change this to point to an alternative directory
94
  which may have different utilities code (from a different branch for instance).</li>
95
  <li>utilities-tag - the tag in the utility repository that Metacat will use to
96
  check out utility code.  You would change this if you want to check out the latest code 
97
  on the head (leave as "") or if you want to run against an older version.</li>
98
  </ul>
99

    
100
  <a name="Cleaning"></a><div class="header1">Cleaning the Codebase</div>
101
  <p>The metacat build.xml has several methods for cleaning the codebase.  The format
102
  for running these is:</p>
103
  <div class="code">ant &lt;clean-target&gt;</div>
104
  The available clean-targets are:
105
  <ul>
106
  <li>clean - removes build and dist dirs.  This will cause a rebuild of code in the 
107
  metacat project.</li>
108
  <li>localclean - does a clean plus removes utilities and httpclient jars.  This 
109
  causes a rebuild of utilities and the metacat project.  This is provided so the 
110
  developer does not need to download all eml files every time utilities change.</li>
111
  <li>ant fullclean - do a localclean plus remove eml files, so the system will 
112
  checkout eml files from the eml module in CVS.</li>
113
  </ul>
114
  
115
  <a name="AutomatedBuild"></a><div class="header1">Automated Build</div>
116
  <p>The ant "install" target controls deploying Metacat locally.  This can be 
117
  used for source distributions or code that was checked out of the repository.
118
  What is does is:</p>
119
  <ul>
120
  <li>Builds the Metacat project, resulting in a war file.</li>
121
  <li>Moves the war file to the app.deploy.dir that you set in build.properties</li>
122
  <li>Removes the existing application directory from the app.deploy.dir.</li>
123
  </ul>
124
  Typical usage would be something like:</p>
125
  <div class="code">ant fullclean install</div>
126
  
127
  <a name="ManualBuild"></a><div class="header1">Manual Build</div>  
128
  <p>You can also build the Metacat war file and deploy manually.  To build and create the 
129
  war, run:</p>
130
  <div class="code">ant build-metacat</div> 
131
  <p>The war file will appear in your &gt;metacat_workspace&lt;/dist directory.  Copy the war
132
  file into your tomcat webapps directory.  Delete the existing code that was expanded
133
  from the old jar.</p>
134
  
135
  <br>
136
  <a href="./metacat-eclipse-project.html">Back</a> | <a href="./index.html">Home</a> | 
137
  <a href="./testing-metacat.html">Next</a>
138
</BODY>
139
</HTML>
(3-3/36)