2007-02-28 17:57:03 -05:00
<!--
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.
-->
2007-01-17 18:56:41 -05:00
<project default= "all" basedir= "." >
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<description >
The first time you build Maven from source, you have to build Maven without Maven.
This Ant script builds a minimal Maven, just enough to re-launch Maven again in this
directory and generate an installation assembly. Then we extract the assembly and
re-run the Maven build one more time, this time with the full generated Maven.
To run this script, you must set the M2_HOME environment variable or the maven.home
property to the location that should contain Maven. This directory *must* be named
after the maven version you want to install, e.g. /usr/local/maven-2.1-SNAPSHOT.
You can set the maven.repo.local property to specify a custom location for your
local repository for the bootstrap process.
</description>
2006-10-11 12:44:55 -04:00
2006-12-10 20:33:39 -05:00
<property file= "build.properties" />
2007-02-09 17:46:35 -05:00
2006-12-06 19:17:53 -05:00
<taskdef resource= "net/sf/antcontrib/antlib.xml" >
<classpath >
<pathelement path= "ant-contrib-1.0b2.jar" />
</classpath>
</taskdef>
2006-10-11 02:23:43 -04:00
<target name= "isMavenHomeSet" >
<property environment= "env" />
<condition property= "maven.home" value= "${env.M2_HOME}" >
<isset property= "env.M2_HOME" />
</condition>
<fail unless= "maven.home"
message="You must set the M2_HOME environment variable or specify a maven.home property to this Ant script"/>
</target>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<target name= "checkMavenHome" depends= "isMavenHomeSet" >
<basename file= "${maven.home}" property= "maven.home.basename" />
<dirname file= "${maven.home}" property= "maven.home.dirname" />
<xmlproperty prefix= "pom" file= "pom.xml" />
<property name= "maven.home.basename.expected" value= "maven-${pom.project.version}" />
<property name= "maven.home.recommended" location= "${maven.home.dirname}/${maven.home.basename.expected}" />
<condition property= "build.failed" >
<not >
<equals arg1= "${maven.home.basename}" arg2= "${maven.home.basename.expected}" />
</not>
</condition>
<fail if= "build.failed" >
The Maven install destination directory must end with '${maven.home.basename.expected}'.
2006-10-11 12:44:55 -04:00
Your M2_HOME was = ${maven.home}
2006-10-11 02:23:43 -04:00
We recommend = ${maven.home.recommended}
</fail>
<echo message= "maven.home=${maven.home}" />
</target>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<target name= "init" depends= "checkMavenHome" >
2006-10-31 14:38:37 -05:00
<xmlproperty file= "${user.home}/.m2/settings.xml" />
<condition property= "maven.repo.local" value= "${settings.localRepository}" >
<isset property= "settings.localRepository" />
</condition>
<condition property= "maven.repo.local" value= "${user.home}/.m2/repository" >
<not >
<isset property= "maven.repo.local" />
</not>
</condition>
<echo > Using Local Repository: ${maven.repo.local}</echo>
2006-10-11 02:23:43 -04:00
</target>
2006-10-11 12:44:55 -04:00
2006-10-20 22:10:23 -04:00
<target name= "clean-bootstrap" description= "cleans up generated bootstrap classes" >
2007-01-17 16:18:17 -05:00
<delete dir= "bootstrap" />
2006-10-20 22:10:23 -04:00
</target>
2006-10-11 02:23:43 -04:00
<!-- DGF TODO Make a simple Java Ant task that pulls dependencies and adds them to a path reference, so we don't have to copy - and - paste -->
<!-- Then again, this *is* a very simple Ant script, so maybe there's no need to get fancy...? -->
<target name= "pull" depends= "init"
description="copies all required dependencies from the Maven remote repository into your local repository. Set the 'skip.pull' property to skip this step, but only if you're sure you already have all of the dependencies downloaded to your local repository"
unless="skip.pull">
<macrodef name= "pull" >
<attribute name= "orgpath" />
<attribute name= "name" />
<attribute name= "version" />
2006-10-31 14:38:37 -05:00
<attribute name= "repository" default= "maven" />
<attribute name= "type" default= "jar" />
2006-10-11 02:23:43 -04:00
<sequential >
2006-10-11 12:44:55 -04:00
<!-- call an ant task to download the artifact. The script cannot be
defined in here, because you cannot re-initialize properties.
Calling the script like this will scope the properties so they can
be re-initialized.
-->
<antcall target= "download-artifact" inheritAll= "true" >
<param name= "orgpath" value= "@{orgpath}" />
<param name= "name" value= "@{name}" />
<param name= "version" value= "@{version}" />
2006-10-31 14:38:37 -05:00
<param name= "repository" value= "@{repository}" />
<param name= "type" value= "@{type}" />
2006-10-11 12:44:55 -04:00
</antcall>
2006-10-11 02:23:43 -04:00
</sequential>
</macrodef>
2006-12-10 20:44:25 -05:00
<pull orgpath= "commons-cli/commons-cli" version= "${commons-cli.version}" name= "commons-cli" />
2007-03-20 17:40:59 -04:00
<pull orgpath= "org/codehaus/plexus/plexus-active-collections" version= "${plexus-active-collections.version}" name= "plexus-active-collections" repository= "codehaus" />
2007-01-12 13:09:03 -05:00
<pull orgpath= "org/codehaus/plexus/plexus-utils" version= "${plexus-utils.version}" name= "plexus-utils" repository= "codehaus" />
<pull orgpath= "org/codehaus/plexus/plexus-container-default" version= "${plexus.version}" name= "plexus-container-default" repository= "codehaus" />
<pull orgpath= "org/codehaus/plexus/plexus-classworlds" version= "${classworlds.version}" name= "plexus-classworlds" repository= "codehaus" />
2006-10-31 14:38:37 -05:00
<pull orgpath= "org/apache/maven/maven-parent" version= "4" name= "maven-parent" type= "pom" />
<pull orgpath= "org/apache/maven/plugins/maven-plugins" version= "4-SNAPSHOT" name= "maven-plugins" type= "pom" />
2007-02-09 17:46:35 -05:00
<pull orgpath= "org/apache/apache" version= "3" name= "apache" type= "pom" />
<!-- Wagon Deps (Start) -->
<pull orgpath= "org/apache/maven/wagon/wagon-provider-api" version= "${wagon.version}" name= "wagon-provider-api" />
2006-12-10 21:20:19 -05:00
<pull orgpath= "org/apache/maven/wagon/wagon-file" version= "${wagon.version}" name= "wagon-file" />
2007-02-09 17:46:35 -05:00
<pull orgpath= "org/apache/maven/wagon/wagon-http-shared" version= "${wagon.version}" name= "wagon-http-shared" />
2006-12-10 21:20:19 -05:00
<pull orgpath= "org/apache/maven/wagon/wagon-http-lightweight" version= "${wagon.version}" name= "wagon-http-lightweight" />
<pull orgpath= "org/apache/maven/wagon/wagon-provider-api" version= "${wagon.version}" name= "wagon-provider-api" />
2007-02-09 17:46:35 -05:00
<!-- Wagon Deps (End) -->
2006-12-10 20:33:39 -05:00
<pull orgpath= "org/apache/maven/doxia/doxia-sink-api" version= "${doxia.version}" name= "doxia-sink-api" />
2006-12-07 22:29:21 -05:00
<pull orgpath= "org/codehaus/modello/modello-core" version= "${modello.version}" name= "modello-core" repository= "codehaus" />
<pull orgpath= "org/codehaus/modello/modello-plugin-xml" version= "${modello.version}" name= "modello-plugin-xml" repository= "codehaus" />
<pull orgpath= "org/codehaus/modello/modello-plugin-xpp3" version= "${modello.version}" name= "modello-plugin-xpp3" repository= "codehaus" />
2007-01-07 14:13:33 -05:00
<pull orgpath= "org/codehaus/modello/modello-plugin-jdom" version= "${modello.version}" name= "modello-plugin-jdom" repository= "codehaus" />
2006-12-10 20:33:39 -05:00
<pull orgpath= "junit/junit" version= "${junit.version}" name= "junit" />
2007-02-09 17:46:35 -05:00
<pull orgpath= "jdom/jdom" version= "${jdom.version}" name= "jdom" />
2007-08-17 02:01:00 -04:00
<pull orgpath= "org/apache/maven/artifact/maven-artifact" version= "${maven-artifact.version}" name= "maven-artifact" />
2006-10-11 02:23:43 -04:00
</target>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<target name= "classpath-pre" depends= "init,pull"
description="constructs a classpath reference containing our dependencies, and verifies that all files are present">
<path id= "pre.classpath" >
2006-12-10 20:33:39 -05:00
<pathelement location= "${maven.repo.local}/commons-cli/commons-cli/${commons-cli.version}/commons-cli-${commons-cli.version}.jar" />
2007-02-09 17:46:35 -05:00
<pathelement location= "${maven.repo.local}/commons-lang/commons-lang/${commons-lang.version}/commons-lang-${commons-lang.version}.jar" />
2007-03-20 17:40:59 -04:00
<pathelement location= "${maven.repo.local}/org/codehaus/plexus/plexus-active-collections/${plexus-active-collections.version}/plexus-active-collections-${plexus-active-collections.version}.jar" />
2006-12-10 20:33:39 -05:00
<pathelement location= "${maven.repo.local}/org/codehaus/plexus/plexus-utils/${plexus-utils.version}/plexus-utils-${plexus-utils.version}.jar" />
<pathelement location= "${maven.repo.local}/org/codehaus/plexus/plexus-container-default/${plexus.version}/plexus-container-default-${plexus.version}.jar" />
<pathelement location= "${maven.repo.local}/org/codehaus/plexus/plexus-classworlds/${classworlds.version}/plexus-classworlds-${classworlds.version}.jar" />
<pathelement location= "${maven.repo.local}/org/codehaus/plexus/plexus-interactivity-api/${plexus-interactivity-api.version}/plexus-interactivity-api-${plexus-interactivity-api.version}.jar" />
2007-02-09 17:46:35 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-manager/${wagon.version}/wagon-manager-${wagon.version}.jar" />
2006-12-10 21:20:19 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-file/${wagon.version}/wagon-file-${wagon.version}.jar" />
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-provider-api/${wagon.version}/wagon-provider-api-${wagon.version}.jar" />
2007-02-09 17:46:35 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-http-shared/${wagon.version}/wagon-http-shared-${wagon.version}.jar" />
2006-12-10 21:20:19 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-http-lightweight/${wagon.version}/wagon-http-lightweight-${wagon.version}.jar" />
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-provider-api/${wagon.version}/wagon-provider-api-${wagon.version}.jar" />
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-ssh-external/${wagon.version}/wagon-ssh-external-${wagon.version}.jar" />
2007-02-09 17:46:35 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-ssh-common/${wagon.version}/wagon-ssh-common-${wagon.version}.jar" />
2006-12-10 21:20:19 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/wagon/wagon-ssh/${wagon.version}/wagon-ssh-${wagon.version}.jar" />
2007-02-09 17:46:35 -05:00
<pathelement location= "${maven.repo.local}/com/jcraft/jsch/${jsch.version}/jsch-${jsch.version}.jar" />
2006-12-10 20:33:39 -05:00
<pathelement location= "${maven.repo.local}/org/apache/maven/doxia/doxia-sink-api/${doxia.version}/doxia-sink-api-${doxia.version}.jar" />
<pathelement location= "${maven.repo.local}/junit/junit/${junit.version}/junit-${junit.version}.jar" />
2007-01-07 14:13:33 -05:00
<pathelement location= "${maven.repo.local}/jdom/jdom/${jdom.version}/jdom-${jdom.version}.jar" />
2007-08-17 02:01:00 -04:00
<pathelement location= "${maven.repo.local}/org/apache/maven/artifact/maven-artifact/${maven-artifact.version}/maven-artifact-${maven-artifact.version}.jar" />
2006-10-11 02:23:43 -04:00
</path>
2007-08-17 02:01:00 -04:00
2006-10-11 02:23:43 -04:00
<!-- DGF Need to keep these modello classes out of the system classpath at runtime, because different parts of the build
2006-10-25 23:31:08 -04:00
need different versions of modello. -->
2006-10-11 02:23:43 -04:00
<path id= "modello.classpath" >
<path refid= "pre.classpath" />
2006-12-07 22:29:21 -05:00
<pathelement location= "${maven.repo.local}/org/codehaus/modello/modello-core/${modello.version}/modello-core-${modello.version}.jar" />
<pathelement location= "${maven.repo.local}/org/codehaus/modello/modello-plugin-xml/${modello.version}/modello-plugin-xml-${modello.version}.jar" />
<pathelement location= "${maven.repo.local}/org/codehaus/modello/modello-plugin-xpp3/${modello.version}/modello-plugin-xpp3-${modello.version}.jar" />
2007-01-07 14:13:33 -05:00
<pathelement location= "${maven.repo.local}/org/codehaus/modello/modello-plugin-jdom/${modello.version}/modello-plugin-jdom-${modello.version}.jar" />
2006-12-06 19:17:53 -05:00
<!--
<pathelement location= "modello.jar" />
-->
2006-10-11 02:23:43 -04:00
</path>
<!-- DGF pathconvert immediately so we can validate the classpath -->
<pathconvert property= "pre.classpath.str" refid= "pre.classpath" pathsep= "
" />
<pathconvert property= "modello.classpath.str" refid= "modello.classpath" pathsep= "
" />
</target>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<target name= "generate-sources" depends= "classpath-pre"
2006-10-11 12:44:55 -04:00
description="generates Java sources from Modello mdo model files"
2006-10-11 18:58:27 -04:00
>
2006-10-11 12:44:55 -04:00
<mkdir dir= "bootstrap/target" />
2007-01-17 16:18:17 -05:00
<mkdir dir= "bootstrap/lib" />
2006-10-11 12:44:55 -04:00
<mkdir dir= "bootstrap/target/generated-sources" />
2006-10-11 02:23:43 -04:00
<macrodef name= "modello-single-mode" >
<attribute name= "file" />
<attribute name= "mode" />
<attribute name= "version" />
<sequential >
2006-12-06 19:17:53 -05:00
<java fork= "fork" classname= "org.codehaus.modello.ModelloCli" failonerror= "true" >
2006-10-11 02:23:43 -04:00
<classpath refid= "modello.classpath" />
<arg file= "@{file}" />
<arg value= "@{mode}" />
2006-10-11 12:44:55 -04:00
<arg file= "bootstrap/target/generated-sources" />
2006-10-11 02:23:43 -04:00
<arg value= "@{version}" />
<arg value= "false" />
</java>
</sequential>
</macrodef>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<macrodef name= "modello" >
<attribute name= "file" />
<attribute name= "version" default= "1.0.0" />
<sequential >
<echo taskname= "modello" message= "Generating sources for @{file}" />
<modello-single-mode file= "@{file}" version= "@{version}" mode= "java" />
<modello-single-mode file= "@{file}" version= "@{version}" mode= "xpp3-reader" />
<modello-single-mode file= "@{file}" version= "@{version}" mode= "xpp3-writer" />
2007-01-07 14:13:33 -05:00
<modello-single-mode file= "@{file}" version= "@{version}" mode= "jdom-writer" />
2006-10-11 02:23:43 -04:00
</sequential>
</macrodef>
2006-10-11 12:44:55 -04:00
2007-01-22 14:24:50 -05:00
<modello file= "maven-model/src/main/mdo/maven.mdo" version= "4.0.0" />
2006-10-11 02:23:43 -04:00
<!-- DGF TODO turn this into a big <apply> task? write a custom task? -->
2007-03-20 17:40:59 -04:00
<modello file= "maven-lifecycle/src/main/mdo/maven-lifecycle.mdo" />
2006-10-11 02:23:43 -04:00
<modello file= "maven-plugin-descriptor/src/main/mdo/lifecycle.mdo" />
<modello file= "maven-plugin-parameter-documenter/src/main/mdo/paramdoc.mdo" />
<modello file= "maven-profile/profiles.mdo" />
2007-01-22 14:24:50 -05:00
<modello file= "maven-settings/src/main/mdo/settings.mdo" />
2006-10-11 02:23:43 -04:00
</target>
<target name= "compile-boot" depends= "generate-sources" description= "compiles the bootstrap sources" >
2007-01-17 16:18:17 -05:00
<echo >
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2007-02-09 17:46:35 -05:00
2007-01-17 16:18:17 -05:00
COMPILE-BOOT
2007-02-09 17:46:35 -05:00
2007-01-17 16:18:17 -05:00
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</echo>
2007-02-09 17:46:35 -05:00
2006-10-11 02:23:43 -04:00
<path id= "sources" >
<dirset dir= "." >
2006-10-11 12:44:55 -04:00
<include name= "bootstrap/target/generated-sources" />
2006-10-11 02:23:43 -04:00
<include name= "*/src/main/*" />
<include name= "maven-reporting/maven-reporting-api/src/main/*" />
<exclude name= "maven-repository-tools/**" />
<exclude name= "maven-core-it-verifier/**" />
</dirset>
</path>
2006-10-11 12:44:55 -04:00
<mkdir dir= "bootstrap/target/classes" />
<javac destdir= "bootstrap/target/classes" debug= "on" >
2006-10-11 02:23:43 -04:00
<src refid= "sources" />
<classpath refid= "pre.classpath" />
</javac>
<!-- DGF generating a fake pom.properties so Maven thinks it has a version number -->
2006-10-11 12:44:55 -04:00
<mkdir dir= "bootstrap/target/classes/META-INF/maven/org.apache.maven/maven-core" />
<echo message= "version=${pom.project.version}"
file="bootstrap/target/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties"/>
2006-10-11 02:23:43 -04:00
<path id= "maven.classpath" >
2006-10-11 12:44:55 -04:00
<pathelement location= "bootstrap/target/classes" />
2006-10-11 02:23:43 -04:00
<path refid= "sources" />
<path refid= "pre.classpath" />
</path>
</target>
<target name= "maven-compile" depends= "compile-boot"
description="compiles Maven using the bootstrap Maven, skipping automated tests">
2007-02-09 17:46:35 -05:00
2007-01-17 16:18:17 -05:00
<echo >
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2007-02-09 17:46:35 -05:00
2007-01-17 16:18:17 -05:00
MAVEN-COMPILE
2007-02-09 17:46:35 -05:00
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</echo>
2006-10-11 02:23:43 -04:00
<java fork= "true" classname= "org.apache.maven.cli.MavenCli" failonerror= "true" >
<classpath refid= "maven.classpath" />
<arg value= "-e" />
2006-10-31 14:38:37 -05:00
<arg value= "-B" />
2006-10-11 02:23:43 -04:00
<arg value= "clean" />
2007-01-17 18:56:41 -05:00
<arg value= "install" />
2006-10-11 02:23:43 -04:00
</java>
</target>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<target name= "maven-assembly" depends= "maven-compile"
description="generates the Maven installation assembly using the bootstrap Maven">
2007-08-09 13:46:33 -04:00
<echo >
The new Maven distribution was created as part of the MAVEN-COMPILE step, above.
This goal just validates the presence of that distribution.
</echo>
2007-03-05 15:34:20 -05:00
<property name= "maven.assembly" location= "maven-embedder/target/${maven.home.basename.expected}-bin.zip" />
2006-10-11 02:23:43 -04:00
<condition property= "build.failed" >
<not >
<available file= "${maven.assembly}" />
</not>
</condition>
2006-12-06 19:17:53 -05:00
<fail if= "build.failed"
message="Assembly task seemed to succeed, but couldn't find assembly file: ${maven.assembly}"/>
2006-10-11 02:23:43 -04:00
</target>
2006-10-11 12:44:55 -04:00
2006-10-11 02:23:43 -04:00
<target name= "extract-assembly" depends= "init,maven-assembly"
description="extracts the maven assembly into maven.home">
2006-12-06 19:17:53 -05:00
<echo > Extracting assembly to ${maven.home.dirname} ...</echo>
2006-10-11 02:23:43 -04:00
<delete dir= "${maven.home}" />
<unzip src= "${maven.assembly}" dest= "${maven.home.dirname}" />
2006-10-11 18:58:27 -04:00
<chmod perm= "+x" >
<fileset dir= "${maven.home}/bin" >
<include name= "mvn" />
<include name= "m2" />
</fileset>
</chmod>
2006-10-11 02:23:43 -04:00
</target>
2006-10-11 12:44:55 -04:00
2006-10-25 23:31:08 -04:00
<target name= "all" depends= "clean-bootstrap,init,extract-assembly" />
2006-10-18 23:37:53 -04:00
2007-01-17 16:56:45 -05:00
<target name= "run-full-maven" depends= "all"
2006-10-11 02:23:43 -04:00
description="runs the full extracted Maven, now with tests">
2007-01-17 18:56:41 -05:00
<property name= "maven.goals" value= "test" />
2006-10-11 02:23:43 -04:00
<java classname= "org.codehaus.classworlds.Launcher" fork= "true" failonerror= "true" >
<classpath >
2007-01-17 16:56:45 -05:00
<fileset dir= "${maven.home}/core/boot" includes= "plexus-classworlds-*.jar" />
2006-10-11 02:23:43 -04:00
</classpath>
<sysproperty key= "classworlds.conf" value= "${maven.home}/bin/m2.conf" />
<sysproperty key= "maven.home" value= "${maven.home}" />
<arg value= "-e" />
<arg line= "${maven.goals}" />
</java>
</target>
2006-10-11 12:44:55 -04:00
<!--
Downloads an artifact, detecting wheter it's a snapshot, and uses the maven-metadata.xml to retrieve
the correct version.
-->
<target name= "download-artifact" >
<!-- choose the proper repository -->
2006-10-31 14:38:37 -05:00
<condition property= "repo" value= "http://snapshots.repository.codehaus.org" >
<and >
<equals arg1= "${repository}" arg2= "codehaus" />
<contains string= "${version}" substring= "SNAPSHOT" />
</and>
</condition>
2006-10-11 18:58:27 -04:00
<condition property= "repo" value= "http://people.apache.org/repo/m2-snapshot-repository"
else="http://repo1.maven.org/maven2">
2006-10-31 14:38:37 -05:00
<and >
<not >
<isset property= "repo" />
</not>
<contains string= "${version}" substring= "SNAPSHOT" />
</and>
2006-10-11 12:44:55 -04:00
</condition>
2006-10-11 13:20:57 -04:00
<mkdir dir= "${maven.repo.local}/${orgpath}/${version}" />
2006-10-11 12:44:55 -04:00
<!-- get the metadata file -->
<get src= "${repo}/${orgpath}/${version}/maven-metadata.xml"
dest="${maven.repo.local}/${orgpath}/${version}/bootstrap-maven-metadata.xml" usetimestamp="true"
ignoreerrors="true"
2006-10-11 18:58:27 -04:00
/>
2006-10-11 12:44:55 -04:00
<!-- Replace 'SNAPSHOT' with 'timestamp - buildnumber'. This is ugly but
ant doesn't allow updating of properties.
-->
2006-12-06 19:17:53 -05:00
<condition property= "localSnapshot" value= "false" >
<not >
<available file= "${maven.repo.local}/${orgpath}/${version}/maven-metadata-local.xml" />
</not>
</condition>
<if >
<equals arg1= "${localSnapshot}" arg2= "false" />
<then >
<xmlproperty file= "${maven.repo.local}/${orgpath}/${version}/bootstrap-maven-metadata.xml" />
<echo file= "deleteme.version.properties" message= "${version}" />
<replaceregexp file= "deleteme.version.properties"
match="SNAPSHOT"
replace="${metadata.versioning.snapshot.timestamp}-${metadata.versioning.snapshot.buildNumber}"
byline="true"/>
<loadfile srcFile= "deleteme.version.properties" property= "fileversion" />
<!-- download the final artifact -->
<get src= "${repo}/${orgpath}/${version}/${name}-${fileversion}.${type}"
dest="${maven.repo.local}/${orgpath}/${version}/${name}-${version}.${type}" usetimestamp="true"
ignoreerrors="false"
/>
2007-02-09 17:46:35 -05:00
2006-12-06 19:17:53 -05:00
</then>
<else >
<property name= "fileversion" value= "SNAPSHOT" />
</else>
</if>
2007-02-09 17:46:35 -05:00
2007-01-17 16:18:17 -05:00
<copy file= "${maven.repo.local}/${orgpath}/${version}/${name}-${version}.${type}" todir= "bootstrap/lib" />
2006-10-11 12:44:55 -04:00
<echo > Resolved version ${fileversion} (given=${version})</echo>
<condition property= "build.failed" >
<not >
2006-10-31 14:38:37 -05:00
<available file= "${maven.repo.local}/${orgpath}/${version}/${name}-${version}.${type}" />
2006-10-11 12:44:55 -04:00
</not>
</condition>
<fail if= "build.failed" message= "Couldn't pull dependency ${orgpath}/${name}/${version}" />
</target>
2006-10-11 02:23:43 -04:00
</project>