Index: lib/maven-ant-tasks-2.1.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: lib/maven-ant-tasks-2.1.0.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: lib/dataone-service-api-0.1.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: lib/dataone-service-api-0.1.0.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: build.properties
===================================================================
--- build.properties	(revision 5294)
+++ build.properties	(revision 5295)
@@ -11,6 +11,10 @@
 # build.tomcat.dir=/usr/local/tomcat
 build.tomcat.dir=/usr/local/devtools/jakarta-tomcat
 
+# The Maven2 installation directory, for building the dataone-service-api
+# Maven is available here: http://maven.apache.org/
+maven.home=/opt/local/share/java/maven2
+
 # install ant target uses this to determine where to drop 
 # the war file in an installation.  Test classes will use
 # this value to find metacat.properties
@@ -80,3 +84,7 @@
 #  do NOT need to be configured
 #metacat.dir=/home/daigle/workspace/metacat
 
+# The location of the dataone source code, defaulting to a directory
+# rooted at a sibling of the current build directory
+d1.dir=../dataone/allsoftware/cicore/service_api
+
Index: build.xml
===================================================================
--- build.xml	(revision 5294)
+++ build.xml	(revision 5295)
@@ -29,13 +29,18 @@
 	* along with this program; if not, write to the Free Software
 	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -->
-<project name="metacat" default="jar" basedir=".">
+<project name="metacat" default="jar" basedir="."
+         xmlns:artifact="antlib:org.apache.maven.artifact.ant">
 	<property environment="env" />
 	<property file="build.properties" /><!-- USER SPECIFIC PROPS -->
 
 
+    <!-- Configure the maven2 ant tasks -->
+    <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.0.jar" />
+    <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+             uri="antlib:org.apache.maven.artifact.ant"
+             classpathref="maven-ant-tasks.classpath" />
 
-
 	<!-- Determine if ecogrid should be installed-->
 	<condition property="enable.ecogrid">
 		<equals arg1="${install.ecogrid}" arg2="true" />
@@ -46,6 +51,14 @@
 		<equals arg1="${make.perl.code}" arg2="true" />
 	</condition>
 
+	<!-- Determine if dataone-service should be built-->
+	<condition property="d1.available">
+        <and>
+	        <available file="${d1.dir}"/>
+	        <available file="${maven.home}"/>
+        </and>
+	</condition>
+
 	<target name="config">
         <!-- Find the servlet-api.jar, depending on the tomcat version. -->
 		<property name="t5.jar" 
@@ -378,7 +391,7 @@
 			url="/tmp/KeplerWebService.wsdl" />
 	</target>
 
-	<target name="compile" depends="prepare,utilities"
+	<target name="compile" depends="dataone-service,prepare,utilities"
 		description="Compiles java code to build dir, and copies metacat props files there">
 
 		<javac srcdir="${build.src}" destdir="${build.dest}"
@@ -1502,4 +1515,17 @@
 			<fileset dir="${dist.dir}" />
 		</copy>
 	</target>
+
+    <!-- Build the dataone service, but only if it is checked out as a
+         sibling of the current build directory. Requires maven2 to
+         be installed and on the path. -->
+    <target name="dataone-service" if="d1.available">
+        <property name="d1.jar" value="dataone-service-api-0.1.0.jar"/>
+
+        <artifact:mvn pom="${d1.dir}/pom.xml" fork="true"
+                      mavenHome="${maven.home}">
+            <arg value="install"/>
+        </artifact:mvn>
+		<copy file="${d1.dir}/target/${d1.jar}" todir="${lib.dir}" />
+    </target>
 </project>
