Skip to content

Commit

Permalink
HIVE-2574 backporting for offline build
Browse files Browse the repository at this point in the history
  • Loading branch information
navis committed Nov 28, 2011
1 parent d2f1ebd commit 19b7ec8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 22 deletions.
10 changes: 1 addition & 9 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,7 @@
<condition property="offline">
<istrue value="${is-offline}"/>
</condition>
<condition property="ivy.cache.name" value="offline" else="online">
<isset property="offline"/>
</condition>
<condition property="ivy.skip">
<and>
<isset property="offline"/>
<available file="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.installed"/>
</and>
</condition>
<import file="build-offline.xml"/>

<!--this is the naming policy for artifacts we want pulled down-->
<property name="ivy.artifact.retrieve.pattern" value="[conf]/[artifact]-[revision](-[classifier]).[ext]"/>
Expand Down
37 changes: 37 additions & 0 deletions build-offline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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.
-->

<!-- common imports for ivy offline mode -->
<project name="hiveoffline">
<condition property="ivy.cache.name" value="offline" else="online">
<isset property="offline"/>
</condition>
<condition property="ivy.checkmodified" value="false" else="true">
<isset property="offline"/>
</condition>
<condition property="ivy.changingPattern" value="" else=".*SNAPSHOT">
<isset property="offline"/>
</condition>
<condition property="ivy.skip">
<and>
<isset property="offline"/>
<available file="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.installed"/>
</and>
</condition>
</project>
11 changes: 1 addition & 10 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,7 @@
<isset property="offline"/>
</condition>

<condition property="ivy.cache.name" value="offline" else="online">
<isset property="offline"/>
</condition>

<condition property="ivy.skip">
<and>
<isset property="offline"/>
<available file="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.installed"/>
</and>
</condition>
<import file="build-offline.xml"/>

<condition property="staging">
<equals arg1="${mvn.publish.repo}" arg2="staging"/>
Expand Down
10 changes: 7 additions & 3 deletions ivy/ivysettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@

<ibiblio name="maven2" root="${repo.maven.org}" pattern="${maven2.pattern.ext}" m2compatible="true"/>
<ibiblio name="apache-snapshot" root="${snapshot.apache.org}" m2compatible="true"
checkmodified="true" changingPattern=".*SNAPSHOT"/>
checkmodified="${ivy.checkmodified}"
changingPattern="${ivy.changingPattern}"/>

<url name="datanucleus-repo" m2compatible="true">
<artifact pattern="${datanucleus.repo}/[organisation]/[module]/[revision]/[module]-[revision].[ext]"/>
Expand All @@ -60,7 +61,9 @@
<ivy pattern="${repo.dir}/org/apache/hadoop/[module]/[revision]/[module]-[revision].pom"/>
</filesystem>

<chain name="default" dual="true" returnFirst="true" checkmodified="true" changingPattern=".*SNAPSHOT">
<chain name="default" dual="true" returnFirst="true"
checkmodified="${ivy.checkmodified}"
changingPattern="${ivy.changingPattern}">
<resolver ref="apache-snapshot"/>
<resolver ref="maven2"/>
<resolver ref="datanucleus-repo"/>
Expand All @@ -86,7 +89,8 @@
<module organisation="org.apache.hadoop" name="hadoop-*" resolver="${resolvers}"/>
</modules>

<caches default="${ivy.cache.name}">
<caches default="${ivy.cache.name}"
resolutionCacheDir="${build.ivy.dir}/resolution-cache">
<cache name="online"/>
<!--
Set the defaultTTL to 1000 days. Ivy 2.1.0 allows you to
Expand Down

0 comments on commit 19b7ec8

Please sign in to comment.