hbase/ivy-targets.xml

112 lines
5.1 KiB
XML

<?xml version="1.0"?>
<!--
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.
-->
<project basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- IVY properteis set here -->
<property name="ivy.repo.dir" value="${user.home}/ivyrepo" />
<loadproperties srcfile="${ivy.dir}/libraries.properties" />
<property name="asfrepo" value="https://repository.apache.org/content/repositories/snapshots" />
<property name="mvnrepo" value="http://repo2.maven.org/maven2" />
<property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar" />
<property name="ant_task.jar" location="${ivy.dir}/maven-ant-tasks-${ant-task.version}.jar" />
<property name="ant_task_repo_url" value="${mvnrepo}/org/apache/maven/maven-ant-tasks/${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar" />
<property name="ivy_repo_url" value="${mvnrepo}/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" />
<property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
<property name="ivy.org" value="org.apache.hadoop" />
<property name="build.ivy.dir" location="${build.dir}/ivy" />
<property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib" />
<property name="common.ivy.lib.dir" location="${build.ivy.lib.dir}/common" />
<property name="test.ivy.lib.dir" location="${build.ivy.lib.dir}/test" />
<property name="build.ivy.report.dir" location="${build.ivy.dir}/report" />
<property name="build.ivy.maven.dir" location="${build.ivy.dir}/maven" />
<!--this is the naming policy for artifacts we want pulled down-->
<property name="ivy.module" location="hadoop-hbase" />
<property name="ivy.artifact.retrieve.pattern" value="[conf]/[artifact]-[revision].[ext]" />
<property name="ivyresolvelog" value="download-only"/>
<property name="ivyretrievelog" value="default"/>
<target name="ivy-init-dirs">
<mkdir dir="${build.ivy.dir}" />
<mkdir dir="${build.ivy.lib.dir}" />
<mkdir dir="${build.ivy.report.dir}" />
<mkdir dir="${build.ivy.maven.dir}" />
<mkdir dir="${common.ivy.lib.dir}" />
</target>
<target name="ivy-probe-antlib">
<condition property="ivy.found">
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache" />
</condition>
</target>
<target name="ivy-download" description="To download ivy" unless="offline">
<get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true" />
</target>
<target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
<typedef uri="antlib:org.apache.ivy.ant" onerror="fail" loaderRef="ivyLoader">
<classpath>
<pathelement location="${ivy.jar}" />
</classpath>
</typedef>
<fail>
<condition>
<not>
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache" />
</not>
</condition>
You need Apache Ivy 2.0 or later from http://ant.apache.org/
It could not be loaded from ${ivy_repo_url}
</fail>
</target>
<target name="ivy-init" depends="ivy-init-antlib">
<!--Configure Ivy by reading in the settings file
If anyone has already read in a settings file into this settings ID, it gets priority
-->
<ivy:configure settingsid="${ant.project.name}.ivy.settings" file="${ivysettings.xml}" override='false' realm="Sonatype Nexus Repository Manager" />
</target>
<target name="ivy-resolve-common" depends="ivy-init">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="common" log="${ivyresolvelog}" />
</target>
<target name="ivy-retrieve-common" depends="ivy-resolve-common" description="Retrieve Ivy-managed artifacts for the compile configurations">
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" log="${ivyretrievelog}" />
<ivy:cachepath pathid="ivy-common.classpath" conf="common" />
</target>
<target name="ivy-resolve-test" depends="ivy-init">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="test" log="${ivyresolvelog}" />
</target>
<target name="ivy-retrieve-test" depends="ivy-resolve-test" description="Retrieve Ivy-managed artifacts for the test configurations">
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" log="${ivyretrievelog}" />
<ivy:cachepath pathid="ivy-common.classpath" conf="test" />
</target>
</project>