| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>7.2 Setting up for Automated Build</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Creating an application with EclipseRT Virgo Web Server"><link rel="up" href="ch07.html" title="7. Automated Build"><link rel="prev" href="ch07.html" title="7. Automated Build"><link rel="next" href="ch07s03.html" title="7.3 Create POM"><!--Begin Google Analytics code--><script type="text/javascript"> |
| var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| </script><script type="text/javascript"> |
| var pageTracker = _gat._getTracker("UA-2728886-3"); |
| pageTracker._setDomainName("none"); |
| pageTracker._setAllowLinker(true); |
| pageTracker._trackPageview(); |
| </script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.2 Setting up for Automated Build</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07.html">Prev</a> </td><th width="60%" align="center">7. Automated Build</th><td width="20%" align="right"> <a accesskey="n" href="ch07s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="automated.build.setup"></a>7.2 Setting up for Automated Build</h2></div></div></div><p> |
| Before building and deploying from the command line, it is important to clean up the artifacts that Eclipse |
| has deployed. In this section the GreenPages application will be undeployed within Eclipse and all of |
| the GreenPages bundles built from the command line. |
| </p><p> |
| Right-click on the <code class="literal">greenpages</code> application in the <code class="literal">Servers</code> view and |
| select <span class="emphasis"><em>Remove</em></span>. Once this is complete close Eclipse: it is no longer needed. |
| </p><div class="mediaobject" align="center"><img src="images/automated-build/remove-application.png" align="middle"></div><p> |
| </p><p> |
| Run the following command from a command prompt with the <code class="filename">$GREENPAGES_HOME/start</code> as the current directory. This will build |
| the individual bundles that make up the GreenPages application: |
| </p><pre class="programlisting">mvn clean install</pre><p> |
| </p><p> |
| The first time this is run will cause Maven to download quite a few packages. It is likely also that |
| this does not build successfully on the first try, due to warnings from Bundlor. These warnings are due to |
| the lack of information regarding some of the packages required by <code class="literal">greenpages.db</code> and <code class="literal">greenpages.web</code>. |
| For example warnings like the following may be issued: |
| </p><pre class="programlisting">[WARNING] Bundlor Warnings: |
| [WARNING] <SB0001W>: The import of package javax.sql does not specify a version. |
| [WARNING] <SB0001W>: The import of package org.apache.commons.dbcp does not specify a version. |
| [INFO] ------------------------------------------------------------------------ |
| [ERROR] BUILD ERROR |
| [INFO] ------------------------------------------------------------------------ |
| [INFO] Bundle transformer returned warnings. |
| Please fix manifest template at '/opt/greenpages-2.3.0.RELEASE/start/greenpages.db/template.mf' |
| and try again. |
| </pre><p> |
| which indicate that there is no information in the <code class="literal">template.mf</code> file in the <code class="literal">greenpages.db</code> project |
| to inform Bundlor what version of these packages to generate in the <code class="literal">MANIFEST.MF</code> for that bundle. |
| </p><p> |
| To correct these problems add the following lines to the <code class="literal">template.mf</code> file for |
| the <code class="literal">greenpages.db</code> bundle: |
| </p><pre class="programlisting">Import-Template: javax.sql;version="0", |
| org.apache.commons.dbcp;version="[1.2.2.osgi, 1.2.2.osgi]" |
| </pre><p> |
| and, if further warnings are issued, in the <code class="literal">template.mf</code> file of other bundles (for example, <code class="literal">greenpages.jpa</code>). |
| </p><p> |
| When the <code class="literal">mvn</code> command returns successfully, go to the next step. |
| </p></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript"> |
| _lf_cid = "LF_48be82fa"; |
| _lf_remora(); |
| </script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch07.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch07s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7. Automated Build </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7.3 Create POM</td></tr></table></div></body></html> |