db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r581313 [4/4] - in /db/jdo/site: docs/ docs/articles/ docs/releases/ docs/tutorials/ xdocs/ xdocs/articles/
Date Tue, 02 Oct 2007 17:10:32 GMT
Modified: db/jdo/site/docs/tutorials/replication.html
URL: http://svn.apache.org/viewvc/db/jdo/site/docs/tutorials/replication.html?rev=581313&r1=581312&r2=581313&view=diff
==============================================================================
--- db/jdo/site/docs/tutorials/replication.html (original)
+++ db/jdo/site/docs/tutorials/replication.html Tue Oct  2 10:10:30 2007
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Java
Data Objects (JDO) - Tutorial : Datastore Replication</title><style type="text/css"
media="all">
           @import url("../style/maven-base.css");
           
-			    @import url("../style/maven-theme.css");</style><link rel="stylesheet" href="../style/print.css"
type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a
href="http://db.apache.org/jdo" id="projectLogo"><img alt="Java Data Objects (JDO)"
src="../images/JDOx120.gif"></img></a><div class="clear"><hr></hr></div></div><div
id="breadcrumbs"><div class="xright"></div><div class="clear"><hr></hr></div></div><div
id="leftColumn"><div id="navcolumn"><div id="menuGeneral"><h5>General</h5><ul><li
class="none"><a href="../index.html">Home</a></li><li class="none"><a
href="../downloads.html">Downloads</a></li><li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0"
class="externalLink" title="External Link">License</a></li></ul></div><br></br><div
id="menuDocumentation"><h5>Documentation</h5><ul><li class="none"><a
href="../specifications.html">Specifications<
 /a></li><li class="none"><a href="../impls.html">Implementations</a></li><li
class="none"><a href="../why_jdo.html">Why JDO?</a></li><li class="none"><a
href="../jdo_v_jpa.html">JDO v JPA</a></li><li class="none"><a href="../jdo_v_jpa_orm.html">JDO
v JPA : ORM</a></li><li class="none"><a href="../enhancement.html">Bytecode
Enhancement</a></li><li class="none"><a href="../glossary.html">Glossary</a></li><li
class="none"><a href="../jdohelper.html">JDOHelper</a></li><li class="none"><a
href="../exceptions.html">Exceptions</a></li><li class="none"><a href="../javadoc.html">API
Javadoc</a></li><li class="none"><a href="../tck.html">TCK</a></li><li
class="none"><a href="../jdo_dtd.html">jdo DTD/XSD</a></li><li class="none"><a
href="../orm_dtd.html">orm DTD/XSD</a></li><li class="none"><a href="../jdoquery_dtd.html">jdoquery
DTD/XSD</a></li><li class="none"><a href="../references.html">References</a></li></ul></div><br></br><div
id="menuTutorials"><h5>Tutorials</h5><ul><li class="
 none"><strong><a href="../tutorials/replication.html">Datastore Replication</a></strong></li></ul></div><br></br><div
id="menuCommunity"><h5>Community</h5><ul><li class="none"><a
href="../get-involved.html">Get Involved</a></li><li class="none"><a
href="../team-list.html">Project Team</a></li><li class="none"><a
href="../mail-lists.html">Mailing Lists</a></li><li class="none"><a
href="../faq.html">FAQ</a></li><li class="none"><a href="http://wiki.apache.org/jdo"
class="externalLink" title="External Link">Wiki</a></li></ul></div><br></br><div
id="menuDevelopment"><h5>Development</h5><ul><li class="none"><a
href="../roadmap.html">RoadMap / TODO</a></li><li class="none"><a
href="../svn.html">Source Code</a></li><li class="none"><a href="http://cwiki.apache.org/GMOxDEV/coding-standards.html"
class="externalLink" title="External Link">Coding Standards</a></li><li
class="none"><a href="../issuetracking.html">Issue Tracking</a></li><li
class="none"><a href="../dependencies.html">De
 pendencies</a></li></ul></div><br></br></div></div><div
id="bodyColumn"><div class="contentBox"><div class="section"><a name="Data_Replication"></a><h2>Data
Replication</h2><p>
+			    @import url("../style/maven-theme.css");</style><link rel="stylesheet" href="../style/print.css"
type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a
href="http://db.apache.org/jdo" id="projectLogo"><img alt="Java Data Objects (JDO)"
src="../images/JDOx120.gif"></img></a><div class="clear"><hr></hr></div></div><div
id="breadcrumbs"><div class="xright"></div><div class="clear"><hr></hr></div></div><div
id="leftColumn"><div id="navcolumn"><div id="menuGeneral"><h5>General</h5><ul><li
class="none"><a href="../index.html">Home</a></li><li class="none"><a
href="../downloads.html">Downloads</a></li><li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0"
class="externalLink" title="External Link">License</a></li></ul></div><br></br><div
id="menuDocumentation"><h5>Documentation</h5><ul><li class="none"><a
href="../specifications.html">Specifications<
 /a></li><li class="none"><a href="../impls.html">Implementations</a></li><li
class="none"><a href="../why_jdo.html">Why JDO?</a></li><li class="none"><a
href="../jdo_v_jpa.html">JDO v JPA</a></li><li class="none"><a href="../jdo_v_jpa_orm.html">JDO
v JPA : ORM</a></li><li class="none"><a href="../enhancement.html">Bytecode
Enhancement</a></li><li class="none"><a href="../glossary.html">Glossary</a></li><li
class="none"><a href="../jdohelper.html">JDOHelper</a></li><li class="none"><a
href="../exceptions.html">Exceptions</a></li><li class="none"><a href="../javadoc.html">API
Javadoc</a></li><li class="none"><a href="../tck.html">TCK</a></li><li
class="none"><a href="../jdo_dtd.html">jdo DTD/XSD</a></li><li class="none"><a
href="../orm_dtd.html">orm DTD/XSD</a></li><li class="none"><a href="../jdoquery_dtd.html">jdoquery
DTD/XSD</a></li><li class="none"><a href="../references.html">References</a></li><li
class="none"><strong><a href="../tutorials/replication.html">Datastore Re
 plication</a></strong></li></ul></div><br></br><div
id="menuArticles"><h5>Articles</h5><ul><li class="none"><a href="../articles/maven-jdo.html">JDO
and Maven1</a></li></ul></div><br></br><div id="menuCommunity"><h5>Community</h5><ul><li
class="none"><a href="../get-involved.html">Get Involved</a></li><li
class="none"><a href="../team-list.html">Project Team</a></li><li
class="none"><a href="../mail-lists.html">Mailing Lists</a></li><li
class="none"><a href="../faq.html">FAQ</a></li><li class="none"><a
href="http://wiki.apache.org/jdo" class="externalLink" title="External Link">Wiki</a></li></ul></div><br></br><div
id="menuDevelopment"><h5>Development</h5><ul><li class="none"><a
href="../roadmap.html">RoadMap / TODO</a></li><li class="none"><a
href="../svn.html">Source Code</a></li><li class="none"><a href="http://cwiki.apache.org/GMOxDEV/coding-standards.html"
class="externalLink" title="External Link">Coding Standards</a></li><li
class="none"><a href="../issuetracking.html
 ">Issue Tracking</a></li><li class="none"><a href="../dependencies.html">Dependencies</a></li></ul></div><br></br></div></div><div
id="bodyColumn"><div class="contentBox"><div class="section"><a name="Data_Replication"></a><h2>Data
Replication</h2><p>
                 There are times when you need to replicate data between datastores. In many
cases datastores themselves provide a means of doing this, however if you want to avoid using
datastore-specific functionality you can utilise JDO to perform this task.
                 JDO2 allows replication by use of detach/attach functionality.
                 We demonstrate this with an example

Modified: db/jdo/site/docs/why_jdo.html
URL: http://svn.apache.org/viewvc/db/jdo/site/docs/why_jdo.html?rev=581313&r1=581312&r2=581313&view=diff
==============================================================================
--- db/jdo/site/docs/why_jdo.html (original)
+++ db/jdo/site/docs/why_jdo.html Tue Oct  2 10:10:30 2007
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Java
Data Objects (JDO) - Why JDO ?</title><style type="text/css" media="all">
           @import url("./style/maven-base.css");
           
-			    @import url("./style/maven-theme.css");</style><link rel="stylesheet" href="./style/print.css"
type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a
href="http://db.apache.org/jdo" id="projectLogo"><img alt="Java Data Objects (JDO)"
src="./images/JDOx120.gif"></img></a><div class="clear"><hr></hr></div></div><div
id="breadcrumbs"><div class="xright"></div><div class="clear"><hr></hr></div></div><div
id="leftColumn"><div id="navcolumn"><div id="menuGeneral"><h5>General</h5><ul><li
class="none"><a href="index.html">Home</a></li><li class="none"><a
href="downloads.html">Downloads</a></li><li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0"
class="externalLink" title="External Link">License</a></li></ul></div><br></br><div
id="menuDocumentation"><h5>Documentation</h5><ul><li class="none"><a
href="specifications.html">Specifications</a></li><li 
 class="none"><a href="impls.html">Implementations</a></li><li class="none"><strong><a
href="why_jdo.html">Why JDO?</a></strong></li><li class="none"><a
href="jdo_v_jpa.html">JDO v JPA</a></li><li class="none"><a href="jdo_v_jpa_orm.html">JDO
v JPA : ORM</a></li><li class="none"><a href="enhancement.html">Bytecode
Enhancement</a></li><li class="none"><a href="glossary.html">Glossary</a></li><li
class="none"><a href="jdohelper.html">JDOHelper</a></li><li class="none"><a
href="exceptions.html">Exceptions</a></li><li class="none"><a href="javadoc.html">API
Javadoc</a></li><li class="none"><a href="tck.html">TCK</a></li><li
class="none"><a href="jdo_dtd.html">jdo DTD/XSD</a></li><li class="none"><a
href="orm_dtd.html">orm DTD/XSD</a></li><li class="none"><a href="jdoquery_dtd.html">jdoquery
DTD/XSD</a></li><li class="none"><a href="references.html">References</a></li></ul></div><br></br><div
id="menuTutorials"><h5>Tutorials</h5><ul><li class="none"><a
href="tutorials/replication.
 html">Datastore Replication</a></li></ul></div><br></br><div
id="menuCommunity"><h5>Community</h5><ul><li class="none"><a
href="get-involved.html">Get Involved</a></li><li class="none"><a
href="team-list.html">Project Team</a></li><li class="none"><a href="mail-lists.html">Mailing
Lists</a></li><li class="none"><a href="faq.html">FAQ</a></li><li
class="none"><a href="http://wiki.apache.org/jdo" class="externalLink" title="External
Link">Wiki</a></li></ul></div><br></br><div id="menuDevelopment"><h5>Development</h5><ul><li
class="none"><a href="roadmap.html">RoadMap / TODO</a></li><li class="none"><a
href="svn.html">Source Code</a></li><li class="none"><a href="http://cwiki.apache.org/GMOxDEV/coding-standards.html"
class="externalLink" title="External Link">Coding Standards</a></li><li
class="none"><a href="issuetracking.html">Issue Tracking</a></li><li
class="none"><a href="dependencies.html">Dependencies</a></li></ul></div><br></br></div></div><div
id="bodyColumn"><div clas
 s="contentBox"><div class="section"><a name="Why_JDO__"></a><h2>Why
JDO ?</h2><p>
+			    @import url("./style/maven-theme.css");</style><link rel="stylesheet" href="./style/print.css"
type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a
href="http://db.apache.org/jdo" id="projectLogo"><img alt="Java Data Objects (JDO)"
src="./images/JDOx120.gif"></img></a><div class="clear"><hr></hr></div></div><div
id="breadcrumbs"><div class="xright"></div><div class="clear"><hr></hr></div></div><div
id="leftColumn"><div id="navcolumn"><div id="menuGeneral"><h5>General</h5><ul><li
class="none"><a href="index.html">Home</a></li><li class="none"><a
href="downloads.html">Downloads</a></li><li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0"
class="externalLink" title="External Link">License</a></li></ul></div><br></br><div
id="menuDocumentation"><h5>Documentation</h5><ul><li class="none"><a
href="specifications.html">Specifications</a></li><li 
 class="none"><a href="impls.html">Implementations</a></li><li class="none"><strong><a
href="why_jdo.html">Why JDO?</a></strong></li><li class="none"><a
href="jdo_v_jpa.html">JDO v JPA</a></li><li class="none"><a href="jdo_v_jpa_orm.html">JDO
v JPA : ORM</a></li><li class="none"><a href="enhancement.html">Bytecode
Enhancement</a></li><li class="none"><a href="glossary.html">Glossary</a></li><li
class="none"><a href="jdohelper.html">JDOHelper</a></li><li class="none"><a
href="exceptions.html">Exceptions</a></li><li class="none"><a href="javadoc.html">API
Javadoc</a></li><li class="none"><a href="tck.html">TCK</a></li><li
class="none"><a href="jdo_dtd.html">jdo DTD/XSD</a></li><li class="none"><a
href="orm_dtd.html">orm DTD/XSD</a></li><li class="none"><a href="jdoquery_dtd.html">jdoquery
DTD/XSD</a></li><li class="none"><a href="references.html">References</a></li><li
class="none"><a href="tutorials/replication.html">Datastore Replication</a></li></ul></div><br></br><div
id="m
 enuArticles"><h5>Articles</h5><ul><li class="none"><a href="articles/maven-jdo.html">JDO
and Maven1</a></li></ul></div><br></br><div id="menuCommunity"><h5>Community</h5><ul><li
class="none"><a href="get-involved.html">Get Involved</a></li><li
class="none"><a href="team-list.html">Project Team</a></li><li class="none"><a
href="mail-lists.html">Mailing Lists</a></li><li class="none"><a href="faq.html">FAQ</a></li><li
class="none"><a href="http://wiki.apache.org/jdo" class="externalLink" title="External
Link">Wiki</a></li></ul></div><br></br><div id="menuDevelopment"><h5>Development</h5><ul><li
class="none"><a href="roadmap.html">RoadMap / TODO</a></li><li class="none"><a
href="svn.html">Source Code</a></li><li class="none"><a href="http://cwiki.apache.org/GMOxDEV/coding-standards.html"
class="externalLink" title="External Link">Coding Standards</a></li><li
class="none"><a href="issuetracking.html">Issue Tracking</a></li><li
class="none"><a href="dependencies.html">Dependencie
 s</a></li></ul></div><br></br></div></div><div
id="bodyColumn"><div class="contentBox"><div class="section"><a name="Why_JDO__"></a><h2>Why
JDO ?</h2><p>
                 The majority of applications need to persist (or store) data during their
lifecycle. There are many ways of doing 
                 this with an application written in Java. 
             </p><p>

Added: db/jdo/site/xdocs/articles/maven-jdo.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/xdocs/articles/maven-jdo.xml?rev=581313&view=auto
==============================================================================
--- db/jdo/site/xdocs/articles/maven-jdo.xml (added)
+++ db/jdo/site/xdocs/articles/maven-jdo.xml Tue Oct  2 10:10:30 2007
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+
+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>JDO and Maven1</title>
+        <author>Andy Jefferson</author>
+    </properties>
+
+    <body>
+    <section name="JDO Meets Maven">
+        <p>
+        By <A HREF="mailto:andy@jpox.org">Andy Jefferson</A>
+        </p>
+
+        <subsection name="Background - Maven">
+            <p><A HREF="http://maven.apache.org" TARGET="_TOP">Maven</A>
is a tool for managing 
+				and building projects providing an alternative to the accepted 
+				<A HREF="http://ant.apache.org" TARGET="_TOP">Ant</A> build process. Maven
is 
+				almost totally plugin-driven, and provides plugins for many common tasks (for 
+				example: building EJB components such as WARs and EARs, generating documentation, 
+				running unit tests) and related software (for example: 
+				<A HREF="http://checkstyle.sf.net" TARGET="_TOP">Checkstyle</A>, 
+				<A HREF="http://pmd.sf.net" TARGET="_TOP">PMD</A>, 
+				<A HREF="http://www.thecortex.net/clover" TARGET="_TOP">Clover</A>, 
+				<A HREF="http://www.jcoverage.com" TARGET="_TOP">JCoverage</A>).</p>
+
+            <p>Maven builds on top of the definition of a project. It formalises project

+				definitions such as dependencies (and hence classpaths), versions, source 
+				repositories, mailing lists, etc. This project definition provides placeholders 
+				for all of the typical metrics important to a project. It formalises the location 
+				of the source tree for a project and of the unit tests. This rigorous structure 
+				allows Maven's plugins to provide generalised functionality such as building the 
+				source tree, running the unit tests, generating javadoc, code analysis, etc.</p>
+
+            <p>Maven operates using the concept of <B>goals</B>. Each <B>goal</B>
can have "pre" 
+				and "post" goals. This structure allows for chaining of operations, with one 
+				operation firing off another, and another to achieve some overall end result.</p>
+        </subsection>
+
+        <subsection name="Integrating JDO with Maven">
+            <p>In developing a JDO system, the developer has many concerns - not least
the likes 
+				of object-relationship mapping - and should, as far as possible, be spared the 
+				"administrative" burdens associated with building the system. Maven's 
+				formalization of the source tree structure and chaining of actions helps achieve 
+				this objective by saving the developer from having to explicitly define tasks 
+				like JDO class bytecode-enhancement. Thus, rather than explicitly invoking a 
+				bytecode-enhancement task in the system build, Maven is able to provide this 
+				activity by way of a plugin, which could even be automatically chained off the 
+				existing Java compilation task.</p>
+        </subsection>
+
+        <subsection name="Anatomy of a Maven JDO plugin">
+            <p>A Maven plugin can use a variety of languages, however most commonly
utilises 
+				<A HREF="http://jakarta.apache.org/commons/jelly/" TARGET="_TOP">Jelly scripting
language</A>, at least for definition of the plugin's goals.
+                A Maven plugin typically requires a minimum of 3 files ... 
+            <UL>
+            <LI><I>project.xml</I> (defining the dependencies of the plugin
on other software)</LI>
+            <LI><I>plugin.jelly</I> (providing the <B>goals</B>
definition)</LI>
+            <LI><I>plugin.properties</I> (properties available for configuration)</LI>
+            </UL>
+                Maven plugins can use a variety of other scripting and templating utilities,
however 
+				these are not currently required for the JDO plugins implemented.</p>
+
+            <p>Plugins have now been developed for 
+				<a HREF="http://www.jpox.org" target="_blank">JPOX</a>, and 
+				<a HREF="http://tjdo.sf.net" TARGET="_blank">TJDO</a>, though can readily
be 
+				developed for any JDO implementation. The best way of understanding the process 
+				involved is by analysing a Maven JDO plugin - in this case, the JPOX plugin. Here 
+				the <I>plugin.jelly</I> file is as follows:</p>
+            <source><![CDATA[
+<goal name="<B>jpox</B>"
+    description="Enhance classes for use with Java Persistent Objects (JPOX)"
+    prereqs="jpox:enhance"/>
+
+<goal name="<B>jpox:init</B>">
+    ... snip ... code to generate <B>jpoxClasspath</B> and <B>jpoxMetaDataFiles</B>
+</goal>
+
+<goal name="<B>jpox:enhance</B>"
+    description="Perform the enhancement of classes for use with JPOX"
+    prereqs="jpox:init">
+    <echo>JDO-enhancing classes for Java Persistent Objects</echo>
+
+    <ant:java dir="${maven.build.dest}"
+        classname="org.jpox.enhance.SunReferenceEnhancer"
+        failonerror="true"
+        fork="true">
+        <classpath refid="jpoxClasspath"/>
+        <arg line="${jpoxMetaDataFiles}"/>
+    </ant:java>
+
+    <echo>Classes are now JDO-enhanced for Java Persistent Objects</echo>
+</goal>]]></source>
+
+            <p>It can be seen that the plugin has several goals, the default one being
to run the 
+				enhance goal. Since this goal requires (as a prerequisite) the running of the init 
+				goal, they are chained.</p>
+
+            <p>Some JDO implementations (for example JPOX, or Kodo) allow the generation
of the 
+				JDO database schema prior to running the JDO-enabled application. This is catered 
+				for with additional <B>goal(s)</B>. For JPOX again, this is handled as follows
</p>
+
+            <source><![CDATA[
+<goal name="<B>jpox:schema-create</B>"
+    prereqs="jpox:init">
+    <echo>Creating tables for Persistence Capability</echo>
+
+    <ant:java dir="${maven.build.dest}"
+        classname="org.jpox.SchemaTool"
+        failonerror="true"
+        fork="true">
+        <classpath refid="jpoxClasspath"/>
+        <sysproperty key="database.driver" value="${maven.jpox.database.driver}"/>
+        <sysproperty key="database.url" value="${maven.jpox.database.url}"/>
+        <sysproperty key="database.user" value="${maven.jpox.database.user}"/>
+        <sysproperty key="database.password" value="${maven.jpox.database.password}"/>
+        <arg line="-create"/>
+        <arg line="${jpoxMetaDataFiles}"/>
+    </ant:java>
+</goal>
+
+<goal name="<B>jpox:schema-delete</B>"
+    prereqs="jpox:init">
+    <echo>Deleting tables for Persistence Capability</echo>
+
+    <ant:java dir="${maven.build.dest}"
+        classname="org.jpox.SchemaTool"
+        failonerror="true"
+        fork="true">
+        <classpath refid="jpoxClasspath"/>
+        <sysproperty key="database.driver" value="${maven.jpox.database.driver}"/>
+        <sysproperty key="database.url" value="${maven.jpox.database.url}"/>
+        <sysproperty key="database.user" value="${maven.jpox.database.user}"/>
+        <sysproperty key="database.password" value="${maven.jpox.database.password}"/>
+        <arg line="-delete"/>
+        <arg line="${jpoxMetaDataFiles}"/>
+    </ant:java>
+    </goal>]]></source>
+
+            <p>Hence there are 2 additional <B>goals</B>, one for creating
all tables required by 
+				JPOX, and a second for deleting these tables. Clearly this has more relevance to 
+				<B>schema generation</B> than for <B>existing schemas</B></p>
+            <p>Where a JDO implementation allows a particular configuration operation,
a Maven 
+				plugin <B>goal</B> can be added to deliver this functionality to the Maven
user. 
+				As a result, individual implementations can add as many goals as they wish to 
+				fulfil their users requirements.</p>
+        </subsection>
+
+        <subsection name="Using a Maven JDO plugin">
+            <p>Using the JPOX Maven plugin as an example, the basic enhancement process
could be 
+				invoked as follows:</p>
+            <source>maven jpox:enhance</source>
+            <p>The problem with this is that it burdens the developer with having to
explicitly 
+				invoke the enhancement process. As an alternative it is possible to integrate 
+				bytecode enhancement as an automatic step chained off the basic Java compilation 
+				process. This is achieved by including the following in the project 
+				<I>maven.xml</I> file:</p>
+            <source><![CDATA[
+<postGoal name="java:compile">
+    <attainGoal name="jpox:enhance"/>
+</postGoal>]]></source>
+
+            <p>So wherever the <B>java:compile</B> goal is called, as a
postGoal it runs the 
+				<B>jpox:enhance</B> goal, leaving the developer with JDO enabled classes
ready to 
+				run.</p>
+
+            <p>Maven's plugins can be made configurable using properties specified
in the 
+				<I>plugin.properties</I> file. For the JPOX plugin, the following properties
can 
+				be set
+            <UL>
+            <LI><B>maven.jpox.jdo.fileset.dir</B> : Directory containing
the JDO MetaData files</LI>
+            <LI><B>maven.jpox.jdo.fileset.include</B> : Fileset include
path for JDO MetaData files (default: **/*.jdo)</LI>
+            <LI><B>maven.jpox.jdo.fileset.exclude</B> : Fileset exclude
path for JDO MetaData files</LI>
+            <LI><B>maven.jpox.database.driver</B> : Driver for use in connecting
to datastore</LI>
+            <LI><B>maven.jpox.database.url</B> : URL defining the datastore</LI>
+            <LI><B>maven.jpox.database.user</B> : Login name for the datastore</LI>
+            <LI><B>maven.jpox.database.password</B> : Password for the
datastore</LI>
+            </UL>
+            For example, the following properties could be included in the Maven <I>project.properties</I>
file</p>
+
+            <source><![CDATA[
+maven.jpox.jdo.fileset.dir=${basedir}/jdo
+maven.jpox.jdo.fileset.include=**/*.jdo
+maven.jpox.database.driver=com.mysql.jdbc.Driver
+maven.jpox.database.url=jdbc:mysql://localhost/jpox
+maven.jpox.database.user={my_username}
+maven.jpox.database.password={my_password}]]></source>
+
+            <p>This would define the JDO MetaData files residing under the "jdo" project
directory, with names matching *.jdo and would be used when all JDO plugin <B>goals</B>
(such as <B>enhance</B>) are called. The 4 <B>database</B> properties
are used in the <B>schema-create/schema-delete</B> goals (as seen in the <I>plugin.jelly</I>
file earlier).</p>
+
+            <p>Invocation of the JPOX schema-create optional goal could be achieved
as follows:</p>
+            <source>maven jpox:schema-create</source>
+        </subsection>
+
+        <subsection name="Conclusion">
+            <p>This article has attempted to give a feel for both the operation of
Maven, and how 
+				to integrate JDO into a Maven project. The various Maven JDO plugins can be 
+				downloaded as follows
+            <UL>
+            <LI>JPOX (1.1.8) - <A HREF="http://www.jpox.org/" TARGET="_blank">Java
Persistent Objects (JPOX) project</A></LI>
+            <LI>TJDO (2.0-beta3) - <A HREF="http://www.ibiblio.org/maven/maven/plugins/"
TARGET="_TOP">Ibiblio site</A></LI>
+            </UL>
+            </p>
+        </subsection>
+
+        <subsection name="About the author">
+            <p>Andy Jefferson is an independent software consultant who has been working
in the 
+				IT industry for more than 15 years, primarily in the United Kingdom. He is an 
+				active participator in several OpenSource projects, primarily JPOX, and 
+				Apache JDO, and a member of the JSR243 (JDO2) Expert Group.</p>
+        </subsection>
+    </section>
+    </body>
+</document>

Modified: db/jdo/site/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/xdocs/navigation.xml?rev=581313&r1=581312&r2=581313&view=diff
==============================================================================
--- db/jdo/site/xdocs/navigation.xml (original)
+++ db/jdo/site/xdocs/navigation.xml Tue Oct  2 10:10:30 2007
@@ -25,10 +25,11 @@
             <item name="orm DTD/XSD" href="/orm_dtd.html"/>
             <item name="jdoquery DTD/XSD" href="/jdoquery_dtd.html"/>
             <item name="References" href="/references.html"/>
+            <item name="Datastore Replication" href="/tutorials/replication.html"/>
         </menu>
 
-        <menu name="Tutorials">
-            <item name="Datastore Replication" href="/tutorials/replication.html"/>
+        <menu name="Articles">
+            <item name="JDO and Maven1" href="/articles/maven-jdo.html"/>
         </menu>
 
         <menu name="Community">



Mime
View raw message