You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by tr...@apache.org on 2012/08/02 17:16:29 UTC

svn commit: r1368604 [1/2] - in /incubator/hcatalog/trunk: ./ ant/ hcatalog-pig-adapter/ ivy/ src/test/ src/test/org/apache/hcatalog/cli/ storage-handlers/ storage-handlers/hbase/ webhcat/svr/

Author: travis
Date: Thu Aug  2 17:16:28 2012
New Revision: 1368604

URL: http://svn.apache.org/viewvc?rev=1368604&view=rev
Log:
HCATALOG-450 : HCatalog should use transitive ivy dependencies

Added:
    incubator/hcatalog/trunk/ant/dependencies.xml
    incubator/hcatalog/trunk/ant/deploy.xml
    incubator/hcatalog/trunk/ant/test.xml
    incubator/hcatalog/trunk/build.properties
    incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestEximSemanticAnalysis.java.broken
Removed:
    incubator/hcatalog/trunk/build-common-new.xml
    incubator/hcatalog/trunk/src/test/all-tests
    incubator/hcatalog/trunk/src/test/excluded-tests
    incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestEximSemanticAnalysis.java
Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/build-common.xml
    incubator/hcatalog/trunk/build.xml
    incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml
    incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml
    incubator/hcatalog/trunk/ivy.xml
    incubator/hcatalog/trunk/ivy/libraries.properties
    incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestPermsGrp.java
    incubator/hcatalog/trunk/storage-handlers/build.xml
    incubator/hcatalog/trunk/storage-handlers/hbase/build.xml
    incubator/hcatalog/trunk/storage-handlers/hbase/ivy.xml
    incubator/hcatalog/trunk/webhcat/svr/build.xml
    incubator/hcatalog/trunk/webhcat/svr/ivy.xml

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Thu Aug  2 17:16:28 2012
@@ -28,6 +28,8 @@ Trunk (unreleased changes)
   HCAT-328 HCatLoader should report its input size so pig can estimate the number of reducers (traviscrawford via gates)
 
   IMPROVEMENTS
+  HCAT-450 HCatalog should use transitive ivy dependencies (traviscrawford)
+
   HCAT-350 Writing BINARY data to HCatRecord depends on a Hive class (thejas via traviscrawford)
 
   HCAT-440 pig field names for arrays should be configurable (traviscrawford)

Added: incubator/hcatalog/trunk/ant/dependencies.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/ant/dependencies.xml?rev=1368604&view=auto
==============================================================================
--- incubator/hcatalog/trunk/ant/dependencies.xml (added)
+++ incubator/hcatalog/trunk/ant/dependencies.xml Thu Aug  2 17:16:28 2012
@@ -0,0 +1,55 @@
+<?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 xmlns:ivy="antlib:org.apache.ivy.ant">
+
+  <target name="_ivy-init" unless="_ivy-init.complete">
+    <echo message="${ant.project.name}"/>
+
+    <mkdir dir="${build.dir}/ivy"/>
+    <mkdir dir="${build.dir}/ivy/report"/>
+
+    <ivy:configure file="${ivysettings.xml}"/>
+    <ivy:makepom ivyfile="${ivy.xml}" pomfile="${pom.file}">
+      <mapping conf="default" scope="compile"/>
+    </ivy:makepom>
+    <property name="_ivy-init.complete" value="true"/>
+  </target>
+
+  <!-- ivy-init exists as two targets so it can be overridden in build.xml.
+       This should be consolidated when core exists as a subproject. -->
+  <target name="ivy-init" depends="_ivy-init"/>
+
+  <target name="_check-ivy-retrieve" unless="ivy-retrieve.complete">
+    <available property="ivy-retrieve.complete" file="${build.dir}/ivy/lib/.ivy-retrieve.complete"/>
+  </target>
+
+  <target name="ivy-retrieve" depends="_check-ivy-retrieve,ivy-init" unless="ivy-retrieve.complete">
+    <echo message="${ant.project.name}"/>
+    <ivy:retrieve sync="true"
+      pattern="${build.dir}/ivy/lib/[conf]/[organization]-[artifact]-[revision](-[classifier]).[ext]"/>
+    <touch file="${build.dir}/ivy/lib/.ivy-retrieve.complete"/>
+  </target>
+
+  <target name="_ivy-report" depends="ivy-retrieve" description="Generate dependency report">
+    <echo message="${ant.project.name}"/>
+    <ivy:report todir="${build.dir}/ivy/report" graph="false"/>
+  </target>
+
+</project>

Added: incubator/hcatalog/trunk/ant/deploy.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/ant/deploy.xml?rev=1368604&view=auto
==============================================================================
--- incubator/hcatalog/trunk/ant/deploy.xml (added)
+++ incubator/hcatalog/trunk/ant/deploy.xml Thu Aug  2 17:16:28 2012
@@ -0,0 +1,30 @@
+<?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 xmlns:ivy="antlib:org.apache.ivy.ant"
+         xmlns:artifact="artifact:org.apache.maven.artifact.ant">
+
+  <target name="mvn-init" unless="mvn-init.complete">
+    <taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
+             uri="artifact:org.apache.maven.artifact.ant"
+             classpath="build/ivy/lib/test/org.apache.maven-maven-ant-tasks-${maven-ant-tasks.version}.jar"/>
+    <property name="mvn-init.complete" value="true"/>
+  </target>
+
+</project>

Added: incubator/hcatalog/trunk/ant/test.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/ant/test.xml?rev=1368604&view=auto
==============================================================================
--- incubator/hcatalog/trunk/ant/test.xml (added)
+++ incubator/hcatalog/trunk/ant/test.xml Thu Aug  2 17:16:28 2012
@@ -0,0 +1,95 @@
+<?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>
+
+  <!-- By default all tests are run. To run one test define -Dtestcase=X on the command line -->
+  <macrodef name="_junit">
+    <attribute name="srcDir"/>
+    <sequential>
+      <!-- If anyone knows how to set umask inside ant please do so -->
+      <exec executable="${path.to.basedir}/bin/umaskcheck.sh" failonerror="true"/>
+
+      <delete dir="${test.logs}"/>
+      <delete dir="${test.warehouse.dir}"/>
+      <mkdir dir="${test.logs}"/>
+      <mkdir dir="${test.warehouse.dir}"/>
+
+      <junit showoutput="${test.output}"
+             printsummary="yes"
+             haltonfailure="no"
+             fork="yes"
+             maxmemory="512m"
+             dir="${test.dir}"
+             timeout="${test.timeout}"
+             errorProperty="tests.failed"
+             failureProperty="tests.failed">
+        <sysproperty key="hadoop.log.dir" value="${test.logs}"/>
+        <sysproperty key="hive.metastore.warehouse.dir" value="${test.warehouse.dir}"/>
+        <sysproperty key="java.security.krb5.realm" value=""/> <!-- HADOOP-7489 -->
+        <sysproperty key="java.security.krb5.kdc" value=""/> <!-- HADOOP-7489 -->
+        <classpath>
+          <path refid="test.class.path"/>
+          <pathelement location="${clover.jar}"/>
+        </classpath>
+        <formatter type="${test.junit.output.format}"/>
+        <batchtest fork="yes" todir="${test.logs}" unless="testcase">
+          <fileset dir="@{srcDir}" includes="**/Test*.java"/>
+        </batchtest>
+        <batchtest fork="yes" todir="${test.logs}" if="testcase">
+          <fileset dir="@{srcDir}" includes="**/${testcase}.java"/>
+        </batchtest>
+        <assertions>
+          <enable/>
+        </assertions>
+      </junit>
+      <fail if="tests.failed">Tests failed!</fail>
+    </sequential>
+  </macrodef>
+
+  <target name="clover-init">
+    <echo message="${ant.project.name}"/>
+    <available property="clover.present" file="${clover.jar}"/>
+    <fail message="'clover.home' is not defined. Please pass -Dclover.home=/path/to/clover to ant on the command-line." unless="clover.present"/>
+    <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
+    <mkdir dir="${clover.db.dir}"/>
+    <clover-setup initString="${clover.db.dir}/hcat_coverage.db">
+      <fileset dir="src" includes="${src.dir}" excludes="**/NoExitSecurityManager.java"/>
+    </clover-setup>
+  </target>
+
+  <target name="_test-with-clover" depends="clover-init, test"
+          description="run unit tests and generate code coverage reports">
+    <echo message="${ant.project.name}"/>
+    <mkdir dir="${clover.report.dir}"/>
+      <clover-report>
+      <current outfile="${clover.report.dir}" title="${final.name}">
+        <format type="html"/>
+      </current>
+      </clover-report>
+    <clover-report>
+      <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
+        <format type="xml"/>
+      </current>
+    </clover-report>
+    <mkdir dir="${clover.pdf.report.dir}"/>
+    <clover-pdf-report outfile="${clover.pdf.report.dir}/clover_coverage.pdf" />
+  </target>
+
+</project>

Modified: incubator/hcatalog/trunk/build-common.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build-common.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/build-common.xml (original)
+++ incubator/hcatalog/trunk/build-common.xml Thu Aug  2 17:16:28 2012
@@ -1,51 +1,94 @@
-<project name="common" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
-    <dirname property="common.basedir" file="${ant.file.common}"/>
-
-    <!-- shared build properties this should be the same with main build.xml -->
-    <!-- this has to resolve to hcatalog project's ${build.dir} -->
-    <property name="common.build.dir" value="${common.basedir}/build"/>
-    <!-- this has to resolve to hcatalog project's ${lib.dir} -->
-    <property name="common.lib.dir" value="${common.basedir}/lib"/>
-    <!-- this has to resolve to hcatalog project's ${ivy.lib.dir} -->
-    <property name="common.ivy.lib.dir" value="${common.build.dir}/ivy/lib/hcatalog"/>
-
-    <!-- hive -->
-    <property name="hive.root" value="${common.basedir}/hive/external"/>
-    <property file="${hive.root}/build.properties" prefix="hive."/>
-    <property name="shims.name" value="20S" />
-    <property name="shims.20S.hive.shims.include" value="0.20,0.20S" />
-    <property name="shims.20S.hadoop.version" value="${hive.hadoop-0.20S.version}" />
-    <property name="shims.23.hive.shims.include" value="0.23" />
-    <property name="shims.23.hadoop.version" value="${hive.hadoop-0.23.version}" />
-
-    <!-- macro to accomplish nested expansion like ${p1.${p2}.name} -->
-    <macrodef name="expandToProperty">
-     <attribute name="name"/>
-     <attribute name="value"/>
-     <sequential>
-        <property name="@{name}" value="${@{value}}" />
-     </sequential>
-    </macrodef>
-    <expandToProperty name="hadoop.version" value="shims.${shims.name}.hadoop.version"/>
-
-    <!-- common classpaths for various builds -->
-    <path id="common.classpath">
-        <fileset dir="${common.ivy.lib.dir}">
-          <include name="**/*.jar" />
-        </fileset>
-    </path>
-
-    <!-- Classpath that includes all sub packages, used for things like Java docs -->
-    <path id="uber.classpath">
-      <fileset dir="${common.ivy.lib.dir}">
-        <include name="**/*.jar" />
-      </fileset>
-      <fileset dir="webhcat/svr/build/ivy/default">
-        <include name="**/*.jar" />
-      </fileset>
-      <fileset dir="webhcat/svr/build/ivy/common">
-        <include name="**/*.jar" />
-      </fileset>
-    </path>
+<?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.
+-->
+
+<project name="build-common-new" default="jar"
+         xmlns:ivy="antlib:org.apache.ivy.ant"
+         xmlns:artifact="artifact:org.apache.maven.artifact.ant">
+
+  <loadproperties srcfile="${path.to.basedir}/build.properties"/>
+  <loadproperties srcfile="${path.to.basedir}/ivy/libraries.properties"/>
+
+  <import file="${path.to.basedir}/ant/dependencies.xml"/>
+  <import file="${path.to.basedir}/ant/deploy.xml"/>
+  <import file="${path.to.basedir}/ant/findbugs.xml"/>
+  <import file="${path.to.basedir}/ant/test.xml"/>
+
+  <macrodef name="_javac">
+    <attribute name="srcDir"/>
+    <attribute name="destDir"/>
+    <attribute name="classPathRef"/>
+    <sequential>
+      <mkdir dir="@{destDir}"/>
+      <javac
+          fork="true"
+          deprecation="false"
+          sourcepath=""
+          includes="**/*.java"
+          encoding="utf-8"
+          srcdir="@{srcDir}"
+          destdir="@{destDir}"
+          classpathref="@{classPathRef}"
+          includeantruntime="false"/>
+    </sequential>
+  </macrodef>
+
+  <target name="clean">
+    <echo message="${ant.project.name}"/>
+    <delete dir="${build.dir}"/>
+  </target>
+
+  <target name="compile" depends="ivy-retrieve">
+    <echo message="${ant.project.name}"/>
+    <_javac srcDir="${basedir}/src/main/java"
+            destDir="${build.classes}"
+            classPathRef="compile.class.path"/>
+  </target>
+
+  <target name="compile-test" depends="jar">
+    <echo message="${ant.project.name}"/>
+    <_javac srcDir="${basedir}/src/test/java"
+            destDir="${test.classes}"
+            classPathRef="test.class.path"/>
+  </target>
+
+  <target name="test" depends="jar, compile-test">
+    <echo message="${ant.project.name}"/>
+    <_junit srcDir="${basedir}/src/test/java"/>
+  </target>
+
+  <target name="jar" depends="compile,mvn-init">
+    <echo message="${ant.project.name}"/>
+    <jar jarfile="${build.dir}/${jar.name}" basedir="${build.classes}"/>
+    <artifact:install file="${build.dir}/${ant.project.name}-${hcatalog.version}.jar">
+      <artifact:pom file="${build.dir}/ivy/${ant.project.name}-${hcatalog.version}.pom"/>
+    </artifact:install>
+  </target>
+
+  <target name="findbugs" depends="init-findbugs,jar">
+    <echo message="${ant.project.name}"/>
+    <_findbugs outputDir="${findbugs.out.dir}"
+               outputFile="${findbugs.report.xmlfile}"
+               excludeFilter="${findbugs.exclude.file}"
+               findbugsReportXmlFile="${findbugs.report.xmlfile}"
+               findbugsReportHtmlFile="${findbugs.report.htmlfile}"
+               sourceDir="${basedir}/src/main/java"
+               jarDir="${build.dir}"
+               classPathRef="findbugs.class.path"/>
+  </target>
 </project>

Added: incubator/hcatalog/trunk/build.properties
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build.properties?rev=1368604&view=auto
==============================================================================
--- incubator/hcatalog/trunk/build.properties (added)
+++ incubator/hcatalog/trunk/build.properties Thu Aug  2 17:16:28 2012
@@ -0,0 +1,60 @@
+_version=0.5.0
+_vtype=-SNAPSHOT
+hcatalog.version=${_version}${_vtype}
+jar.name=${ant.project.name}-${hcatalog.version}.jar
+hcatalog.jar=${ant.project.name}-${hcatalog.version}.jar
+hcatalog.core.jar=${ant.project.name}-core-${hcatalog.version}.jar
+final.name=${ant.project.name}-${hcatalog.version}
+package.release=1
+
+build.dir=${basedir}/build
+build.classes=${build.dir}/classes
+src.dir=${basedir}/src/java
+package.dir=${basedir}/src/packages
+docs.src=${basedir}/src/docs
+build.classes=${build.dir}/classes
+build.docs=${build.dir}/docs
+build.javadoc=${build.docs}/api
+dist.dir=${build.dir}/${final.name}
+
+test.dir=${build.dir}/test
+test.classes=${test.dir}/classes
+test.logs=${test.dir}/logs
+test.timeout=2700000
+test.warehouse.dir=${test.dir}/hcat_junit_warehouse
+mvnrepo=http://repo2.maven.org/maven2
+test.src.dir=${basedir}/src/test
+test.junit.output.format=plain
+test.all.file=${test.src.dir}/all-tests
+test.exclude.file=${test.src.dir}/excluded-tests
+test.output=no
+test.excludes=e2e/**
+clover.jar=${clover.home}/lib/clover.jar
+clover.db.dir=${build.dir}/test/clover/db
+clover.report.dir=${build.dir}/test/clover/reports
+clover.pdf.report.dir=${build.dir}/test/clover/pdf/reports
+
+ivysettings.xml=${path.to.basedir}/ivy/ivysettings.xml
+ivy.xml=${basedir}/ivy.xml
+pom.file=${build.dir}/ivy/${ant.project.name}-${hcatalog.version}.pom
+
+findbugs.out.dir=${test.dir}/findbugs
+findbugs.exclude.file=${basedir}/src/test/findbugsExcludeFile.xml
+findbugs.report.htmlfile=${findbugs.out.dir}/hcat-findbugs-report.html
+findbugs.report.xmlfile=${findbugs.out.dir}/hcat-findbugs-report.xml
+
+build.encoding=UTF8
+excludes=
+javac.debug=on
+javac.optimize=on
+javac.deprecation=off
+javac.version=1.6
+javac.args=
+
+
+# hive properties
+shims.name=20S
+shims.20S.hive.shims.include=0.20,0.20S
+shims.20S.hadoop.version=${hive.hadoop-0.20S.version}
+shims.23.hive.shims.include=0.23
+shims.23.hadoop.version=${hive.hadoop-0.23.version}

Modified: incubator/hcatalog/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/build.xml (original)
+++ incubator/hcatalog/trunk/build.xml Thu Aug  2 17:16:28 2012
@@ -17,74 +17,25 @@
    limitations under the License.
 -->
 
+<project name="hcatalog" default="jar"
+         xmlns:ivy="antlib:org.apache.ivy.ant"
+         xmlns:artifact="artifact:org.apache.maven.artifact.ant">
+
+  <property name="path.to.basedir" location="${basedir}"/>
+
+  <loadproperties srcfile="${basedir}/build.properties"/>
 
-<project name="hcatalog" default="jar" xmlns:ivy="antlib:org.apache.ivy.ant" >
   <!--  
   ================================================================================
   Imports
   ================================================================================ -->
-  <import file="build-common.xml"/>
 
   <!--
   ================================================================================
   Properties and Classpaths Section
   ================================================================================
   -->
-  <!-- name and version -->
-  <property name="_version" value="0.5.0"/>
-  <property name="_vtype" value="-dev"/> 
-  <property name="hcatalog.version" value="${_version}${_vtype}"/>
-  <property name="hcatalog.jar" value="${ant.project.name}-${hcatalog.version}.jar"/>
-  <property name="hcatalog.core.jar" value="${ant.project.name}-core-${hcatalog.version}.jar"/>
-  <property name="final.name" value="${ant.project.name}-${hcatalog.version}" />
-  <property name="package.release" value="1"/>
-
-  <!-- build properties -->
-  <property name="lib.dir" value="${basedir}/lib/" />
-  <property name="src.dir"  location="${basedir}/src/java"/>
-  <property name="package.dir"  location="${basedir}/src/packages"/>
-  <property name="docs.src" value="${basedir}/src/docs"/>
-  <property name="build.dir" value="${basedir}/build"/>
-  <property name="build.classes" value="${build.dir}/classes" />
-  <property name="build.docs" value="${build.dir}/docs" />
-  <property name="build.javadoc" value="${build.docs}/api" />
-  <property name="dist.dir" value="${build.dir}/${final.name}" />
-
-  <!-- javac properties -->
-  <property name="build.encoding" value="UTF8" />
-  <property name="excludes" value=""/>
-  <property name="javac.debug" value="on" />
-  <property name="javac.optimize" value="on" />
-  <property name="javac.deprecation" value="off" />
-  <property name="javac.version" value="1.6" />
-  <property name="javac.args" value="" />
-
-  <!-- test properties -->
-  <property name="test.src.dir" value="${basedir}/src/test" />
-  <property name="test.build.dir" value="${build.dir}/test" />
-  <property name="test.build.classes" value="${test.build.dir}/classes" />
-  <property name="test.log.dir" value="${test.build.dir}/logs" />
-  <property name="test.timeout" value="2700000" />
-  <property name="test.junit.output.format" value="plain" />
-  <property name="test.all.file" value="${test.src.dir}/all-tests"/>
-  <property name="test.exclude.file" value="${test.src.dir}/excluded-tests"/>
-  <property name="test.output" value="no"/>
-  <property name="test.warehouse.dir" value="/tmp/hcat_junit_warehouse"/>
-  <property name="test.excludes" value="e2e/**"/>
-
-  <property name="clover.db.dir" location="${build.dir}/test/clover/db"/>
-  <property name="clover.report.dir" location="${build.dir}/test/clover/reports"/>
-  <property name="clover.pdf.report.dir" location="${build.dir}/test/clover/pdf/reports"/>
-  <property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
-  <available property="clover.present" file="${clover.jar}" />
-
-  <!-- check if clover reports should be generated -->
-  <condition property="clover.enabled">
-    <and>
-      <isset property="run.clover"/>
-      <isset property="clover.present"/>
-    </and>
-  </condition>
+
   <condition property="staging">
     <equals arg1="${repo}" arg2="staging"/>
   </condition>
@@ -123,156 +74,71 @@
   <property name="package.buildroot" value="${build.dir}/rpm/hcatalog_package_build_${user.name}"/>
   <property name="package.build.dir" value="${build.dir}/rpm/hcatalog_package_build_${user.name}/BUILD"/>
 
-  <condition property="os-arch" value="x86_64">
-      <and>
-	<os arch="amd64" />
-      </and>
-    </condition>
-    <condition property="os-arch" value="i386">
-      <or>
-	<os arch="i386" />
-	<os arch="i486" />
-	<os arch="i586" />
-	<os arch="i686" />
-      </or>
-    </condition>
-
   <!-- rats properties -->
   <property name="rat.reporting.classname" value="rat.Report"/>
 
-  <!--this is the naming policy for artifacts we want pulled down-->
-  <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[artifact]-[revision](-[classifier]).[ext]"/>
-
-  <!-- Classpaths for various builds -->
-  <path id="classpath">
-    <path refid="common.classpath"/>
+  <path id="compile.classpath">
+    <fileset dir="${build.dir}/ivy/lib/default">
+      <include name="**/*.jar"/>
+    </fileset>
   </path>
 
-  <condition property="os-arch" value="x86_64">
-    <and>
-      <os arch="amd64" />
-    </and>
-  </condition>
-  <condition property="os-arch" value="i386">
-    <or>
-      <os arch="i386" />
-      <os arch="i486" />
-      <os arch="i586" />
-      <os arch="i686" />
-    </or>
-  </condition>
-
-  <path id="test.classpath">
-    <pathelement location="${test.build.classes}" />
-    <pathelement location="${build.classes}" />
+  <path id="test.class.path">
+    <pathelement location="${test.classes}"/>
+    <pathelement location="${build.classes}"/>
     <pathelement location="conf"/>
-    <fileset dir="${ivy.lib.dir}">
-      <include name="**/*.jar" />
+    <fileset dir="${build.dir}/ivy/lib/test">
+      <include name="**/*.jar"/>
     </fileset>
-    <pathelement location="${hcatalog.jar}"/>
+    <pathelement location="${basedir}/hcatalog-pig-adapter/build/hcatalog-pig-adapter-${hcatalog.version}.jar"/>
   </path>
 
-  <!--
-  ================================================================================
-  Ivy Section
-  ================================================================================
-  -->
-  <!-- Ivy goop stolen directly from Pig's build.xml -->
-  <target name="ivy-init-dirs">
-    <mkdir dir="${build.ivy.dir}" />
-    <mkdir dir="${build.ivy.lib.dir}" />
-    <mkdir dir="${build.ivy.report.dir}" />
-  </target>
+  <!-- Classpath that includes all sub packages, used for things like Java docs -->
+  <path id="uber.classpath">
+    <fileset dir="${basedir}">
+      <include name="**/build/ivy/lib/default/*.jar"/>
+    </fileset>
+  </path>
 
-  <target name="ivy-probe-antlib" >
-    <condition property="ivy.found">
-      <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
-    </condition>
+  <!-- This is a little janky because hcatalog-core.jar is not yet a submodule. -->
+  <target name="ivy-report" depends="ivy-retrieve">
+    <antcall target="_ivy-report"/>
+    <ant target="_ivy-report" dir="hcatalog-pig-adapter" inheritAll="false" useNativeBasedir="true"/>
+    <ant target="ivy-report" dir="storage-handlers" inheritAll="false" useNativeBasedir="true"/>
   </target>
 
   <target name="ivy-download" description="To download ivy" unless="offline">
-    <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
-  </target>
-
-  <!--
-     To avoid Ivy leaking things across big projects, always load Ivy in the same classloader.
-     Also note how we skip loading Ivy if it is already there, just to make sure all is well.
-  -->
-  <target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
+    <echo message="${ant.project.name}"/>
+    <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true" skipexisting="true"/>
     <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'/>
-    <ivy:makepom ivyfile="${ivy.xml}" pomfile="${pom.file}"/>
-  </target>
-
-  <target name="ivy-compile" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for compile configuration">
-    <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="common"/>
-    <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="common"/>
-    <ivy:cachepath pathid="compile.classpath" conf="common"/>     
-    <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="default"/>
-    <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="default"/>
-    <ivy:cachepath pathid="compile.classpath" conf="default"/>     
-  </target>
-
-  <target name="ivy-package" depends="ivy-init"
-    description="Retrieve Ivy-managed artifacts for the package configurations">
-    <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="package"/>
-    <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="package"/>
-    <ivy:cachepath pathid="package.classpath" conf="package"/>
-  </target>
-
-  <target name="ivy-releaseaudit" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for releaseaudit configuration">
-    <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="releaseaudit"/>
-    <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="releaseaudit"/>
-    <ivy:cachepath pathid="releaseaudit.classpath" conf="releaseaudit"/>
-  </target>
-
-  <target name="ivy-publish" depends="ivy-init">
-    <ivy:publish
-        resolver="local"
-        organisation="org.apache.hcatalog"
-        module="${ant.project.name}"
-        revision="${hcatalog.version}"
-        overwrite="true">
-      <artifacts pattern="${build.dir}/${ant.project.name}/[artifact]-[revision](-[classifier]).[ext]"/>
-    </ivy:publish>
-  </target>
-
-  <target name="ivy-report" depends="ivy-init" description="Generate Ivy dependency report">
-    <ivy:report todir="${build.ivy.report.dir}"
-      conf="common, default"
-      organisation="org.apache.hcatalog"
-      module="hcatalog"
-      graph="false"/>
   </target>
 
-  <target name="init" depends="ivy-compile, ivy-package" >
+  <target name="ivy-init" depends="ivy-download,_ivy-init">
+    <!-- HCatalog started as a single source tree that produced multiple artifacts.
+    Currently its going through a transition to subprojects. During this transition
+    we jank together pom files for artifacts produced in the existing source tree until
+    they are correctly generated from per-subproject ivy.xml files. -->
+    <copy file="${pom.file}" tofile="${build.ivy.dir}/hcatalog-core-${hcatalog.version}.pom"
+          overwrite="true"/>
+    <replace file="${build.ivy.dir}/hcatalog-core-${hcatalog.version}.pom"
+             token="artifactId>hcatalog"
+             value="artifactId>hcatalog-core"/>
+
+    <copy file="${pom.file}" overwrite="true"
+          tofile="${build.ivy.dir}/hcatalog-server-extensions-${hcatalog.version}.pom"/>
+    <replace file="${build.ivy.dir}/hcatalog-server-extensions-${hcatalog.version}.pom"
+             token="artifactId>hcatalog"
+             value="artifactId>hcatalog-server-extensions"/>
+  </target>
+
+  <target name="init" depends="ivy-retrieve,mvn-init">
     <mkdir dir="${dist.dir}" />
     <mkdir dir="${build.classes}" />
-    <mkdir dir="${test.build.classes}" />
+    <mkdir dir="${test.classes}" />
   </target>
 
   <!--
@@ -288,7 +154,7 @@
         source="${javac.version}" deprecation="${javac.deprecation}"
         includeantruntime="false">
       <compilerarg line="${javac.args}"/>
-      <classpath refid="classpath" />
+      <classpath refid="compile.classpath"/>
     </javac>
     <!-- compile shim for selected hadoop version -->
     <!--property name="debugclasspath" refid="classpath"/>
@@ -299,7 +165,7 @@
         source="${javac.version}" deprecation="${javac.deprecation}"
         includeantruntime="false">
       <compilerarg line="${javac.args}"/>
-      <classpath refid="classpath" />
+      <classpath refid="compile.classpath"/>
     </javac>
   </target>
  
@@ -307,6 +173,9 @@
   <target name="clientjar" depends="compile-src">
     <jar jarfile="${build.dir}/${ant.project.name}/${hcatalog.core.jar}"
          basedir="${build.classes}"/>
+    <artifact:install file="${build.dir}/${ant.project.name}/${hcatalog.core.jar}">
+      <artifact:pom file="${build.ivy.dir}/hcatalog-core-${hcatalog.version}.pom"/>
+    </artifact:install>
   </target>
 
   <!--
@@ -314,11 +183,13 @@
   Build server side code, mainly listener.
   ================================================================================
   -->
-  <!-- Build the server side jar -->
   <target name="server-extensions" depends="compile-src">
-     <jar jarfile="${build.dir}/${ant.project.name}/${ant.project.name}-server-extensions-${hcatalog.version}.jar" basedir="${build.classes}"
- 	  includes="org/apache/hcatalog/listener/**,org/apache/hcatalog/metadata/**">
-  </jar>
+    <jar jarfile="${build.dir}/${ant.project.name}/${ant.project.name}-server-extensions-${hcatalog.version}.jar"
+         basedir="${build.classes}"
+         includes="org/apache/hcatalog/listener/**,org/apache/hcatalog/metadata/**"/>
+    <artifact:install file="${build.dir}/${ant.project.name}/${ant.project.name}-server-extensions-${hcatalog.version}.jar">
+      <artifact:pom file="${build.ivy.dir}/hcatalog-server-extensions-${hcatalog.version}.pom"/>
+    </artifact:install>
   </target>
 
   <!--
@@ -330,6 +201,8 @@
     <ant target="jar" dir="hcatalog-pig-adapter" inheritAll="false"/>
     <ant target="jar" dir="webhcat/svr" inheritAll="false"/>
 
+    <!-- Build hcatalog.jar, bundling the pig adapter. Our intention is to stop producing this
+         fat jar after some migration period. -->
     <jar jarfile="${build.dir}/${ant.project.name}/${hcatalog.jar}">
       <zipfileset src="${build.dir}/${ant.project.name}/${hcatalog.core.jar}"/>
       <zipfileset src="hcatalog-pig-adapter/build/hcatalog-pig-adapter-${hcatalog.version}.jar"/>
@@ -353,132 +226,40 @@
   -->
   <!-- Build HCatalog test files -->
   <target name="compile-test" depends="jar">
-    <javac encoding="${build.encoding}" srcdir="${test.src.dir}" excludes="${test.excludes}"
-        includes="**/*.java" destdir="${test.build.classes}" debug="${javac.debug}"
-        optimize="${javac.optimize}" target="${javac.version}"
-        source="${javac.version}" deprecation="${javac.deprecation}"
+    <javac
+        encoding="${build.encoding}"
+        srcdir="${test.src.dir}"
+        excludes="${test.excludes}"
+        includes="**/*.java"
+        destdir="${test.classes}"
+        debug="${javac.debug}"
+        optimize="${javac.optimize}"
+        target="${javac.version}"
+        source="${javac.version}"
+        deprecation="${javac.deprecation}"
         includeantruntime="false">
       <compilerarg line="${javac.args}"/>
-      <classpath>
-        <path refid="test.classpath"/>
-        <pathelement path="hcatalog-pig-adapter/build/hcatalog-pig-adapter-${hcatalog.version}.jar"/>
-      </classpath>
+      <classpath refid="test.class.path"/>
     </javac>
   </target>
 
-  <!-- Run the unit tests -->
-  <target name="test-storage-handlers">
-    <ant target="test" dir="storage-handlers" inheritAll="false" useNativeBasedir="true"/>
-  </target>
-
-  <target name="test" depends="compile-test">
-    <sequential>
-      <!-- If anyone knows how to set umask inside ant please do so -->
-      <exec executable="bin/umaskcheck.sh" failonerror="true"/>
-      <delete dir="${test.log.dir}"/>
-      <delete dir="${test.warehouse.dir}"/>
-      <mkdir dir="${test.log.dir}"/>
-      <mkdir dir="${test.warehouse.dir}"/>
-      <junit showoutput="${test.output}" printsummary="yes" haltonfailure="no"
-          fork="yes" maxmemory="512m" dir="${basedir}" timeout="${test.timeout}"
-          errorProperty="tests.failed" failureProperty="tests.failed">
-        <sysproperty key="hadoop.log.dir" value="${test.log.dir}"/>
-        <sysproperty key="hive.metastore.warehouse.dir" value="${test.warehouse.dir}"/>
-        <classpath>
-          <pathelement location="${test.build.classes}" />
-          <pathelement location="." />
-          <pathelement path="${clover.jar}"/>
-          <path refid="test.classpath"/>
-          <pathelement path="hcatalog-pig-adapter/build/hcatalog-pig-adapter-${hcatalog.version}.jar"/>
-        </classpath>
-        <formatter type="${test.junit.output.format}" />
-        <!-- If the user has not defined a particular test to run, run them all -->
-        <batchtest fork="yes" todir="${test.log.dir}" unless="testcase">
-          <fileset dir="src/test">
-            <patternset>
-              <includesfile name="${test.all.file}"/>
-              <excludesfile name="${test.exclude.file}"/>
-            </patternset>
-          </fileset>
-        </batchtest>
-        <!-- Run one test case.  To use this define -Dtestcase=X on the command line -->
-        <batchtest fork="yes" todir="${test.log.dir}" if="testcase">
-          <fileset dir="src/test" includes="**/${testcase}.java"/>
-        </batchtest>
-
-        <assertions>
-          <enable />
-        </assertions>
-
-      </junit>
-      <fail if="tests.failed">Tests failed!</fail>
-    </sequential>
+  <target name="test" depends="compile-test" description="run unit tests">
+    <_junit srcDir="${basedir}/src/test"/>
     <ant target="test" dir="hcatalog-pig-adapter" inheritAll="false"/>
     <ant target="test" dir="webhcat/svr" inheritAll="false"/>
-    <antcall target="test-storage-handlers"/>
+    <ant target="test" dir="storage-handlers" inheritAll="false" useNativeBasedir="true"/>
   </target>
 
-<!-- TMP REMOVE THIS -->
-  <target name="hack-test" depends="compile-test">
-    <ant target="test" dir="webhcat/svr" inheritAll="false"/>
+  <target name="test-with-clover" depends="clover-init, compile-test"
+          description="run unit tests and generate code coverage reports">
+    <_junit srcDir="${basedir}/src/test"/>
+    <ant target="_test-with-clover" dir="hcatalog-pig-adapter" inheritAll="false"/>
+    <ant target="_test-with-clover" dir="webhcat/svr" inheritAll="false"/>
+    <!-- storage-handlers do not have coverage as they have not
+         yet been migrated to the new build files. -->
+    <ant target="test" dir="storage-handlers" inheritAll="false" useNativeBasedir="true"/>
   </target>
-  
-  <!--
-  ================================================================================
-  Clover Section
-  ================================================================================
-  -->
 
-  <target name="clover" depends="clover.setup, clover.info"
-      description="Instrument the Unit tests using Clover.  To use, specify 
-      -Dclover.home=&lt;base of clover installation&gt; -Drun.clover=true on
-      the command line."/>
-
-  <target name="clover.setup" if="clover.enabled">
-    <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
-    <mkdir dir="${clover.db.dir}"/>
-    <clover-setup initString="${clover.db.dir}/hcat_coverage.db">
-      <fileset dir="src" includes="**/*.java" excludes="**/NoExitSecurityManager.java"/>
-      <fileset dir="webhcat/svr/src/main/java" includes="**/*.java"/>
-      <fileset dir="storage-handlers/hbase/src/java" includes="**/*.java"/>
-      <fileset dir="hcatalog-pig-adapter/src/main/java" includes="**/*.java"/>
-    </clover-setup>
-  </target>
-
-  <target name="clover.info" unless="clover.present">
-    <echo>
-      Clover not found. Code coverage reports disabled.
-    </echo>
-  </target>
-
-  <target name="clover.check">
-    <fail unless="clover.present">
-      ##################################################################
-        Clover not found.
-        Please specify -Dclover.home=&lt;base of clover installation&gt;
-        on the command line.
-       ##################################################################
-    </fail>
-  </target>
-
-  <target name="generate-clover-reports" depends="clover.check, clover">
-    <mkdir dir="${clover.report.dir}"/>
-      <clover-report>
-      <current outfile="${clover.report.dir}" title="${final.name}">
-        <format type="html"/>
-      </current>
-      </clover-report>
-    <clover-report>
-      <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
-        <format type="xml"/>
-      </current>
-    </clover-report>
-  </target>
-
-  <target name="generate-pdf-clover-reports" depends="clover.check, clover">
-    <mkdir dir="${clover.pdf.report.dir}"/>
-    <clover-pdf-report outfile="${clover.pdf.report.dir}/clover_coverage.pdf" />
-  </target>
 
   <!--
   ================================================================================
@@ -487,17 +268,13 @@
   -->
 
   <target name="findbugs" depends="init-findbugs,jar">
-    <property name="findbugs.out.dir" value="${test.build.dir}/findbugs"/>
+    <property name="findbugs.out.dir" value="${test.dir}/findbugs"/>
     <property name="findbugs.exclude.file" value="${test.src.dir}/findbugsExcludeFile.xml"/>
     <property name="findbugs.report.htmlfile"
       value="${findbugs.out.dir}/hcat-findbugs-report.html"/>
     <property name="findbugs.report.xmlfile"
       value="${findbugs.out.dir}/hcat-findbugs-report.xml"/>
 
-    <path id="findbugs.class.path">
-      <fileset dir="${ivy.lib.dir}"/>
-    </path>
-
     <_findbugs outputDir="${findbugs.out.dir}"
                outputFile="${findbugs.report.xmlfile}"
                excludeFilter="${findbugs.exclude.file}"
@@ -505,7 +282,7 @@
                findbugsReportHtmlFile="${findbugs.report.htmlfile}"
                sourceDir="${src.dir}"
                jarDir="${build.dir}/${ant.project.name}"
-               classPathRef="findbugs.class.path"/>
+               classPathRef="compile.classpath"/>
 
     <ant target="findbugs" dir="hcatalog-pig-adapter" inheritAll="false"/>
     <ant target="findbugs" dir="webhcat/svr" inheritAll="false"/>
@@ -518,6 +295,7 @@
   -->
   <!-- Clean up children -->
   <target name="clean" description="Cleanup all build artifacts">
+    <echo message="${ant.project.name}"/>
     <delete dir="${build.dir}" />
     <delete dir="${test.warehouse.dir}"/>
     <ant target="clean" dir="hcatalog-pig-adapter" inheritAll="false"/>
@@ -559,15 +337,10 @@
       <packageset dir="${src.dir}" />
       <packageset dir="hcatalog-pig-adapter/src/main/java" />
       <packageset dir="webhcat/svr/src/main/java" />
-      <!--
-        <classpath>
-          <path refid="classpath" />
-        </classpath>
-        -->
-        <classpath>
-          <path refid="uber.classpath"/>
-        </classpath>
-        <group title="hcatalog" packages="org.apache.hcatalog.*" />
+      <classpath>
+        <path refid="uber.classpath"/>
+      </classpath>
+      <group title="hcatalog" packages="org.apache.hcatalog.*"/>
     </javadoc>
   </target>
 
@@ -679,7 +452,7 @@
       <antcall target="package-storage-handlers"/>
     </target>
 
-    <target name="releaseaudit" depends="ivy-releaseaudit" description="Release Audit activities">
+    <target name="releaseaudit" depends="ivy-retrieve" description="Release Audit activities">
       <java classname="${rat.reporting.classname}" fork="true">
         <classpath refid="releaseaudit.classpath"/>
         <arg value="${basedir}/src"/>
@@ -748,6 +521,9 @@
         <ant dir="${test.e2e.dir}" target="deploy"/>
     </target>
 
+  <import file="ant/dependencies.xml"/>
+  <import file="ant/deploy.xml"/>
   <import file="ant/findbugs.xml"/>
+  <import file="ant/test.xml"/>
 
 </project>

Modified: incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml (original)
+++ incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml Thu Aug  2 17:16:28 2012
@@ -19,32 +19,21 @@
 
 <project name="hcatalog-pig-adapter">
   <property name="path.to.basedir" value="${basedir}/.."/>
-  <import file="../build-common-new.xml"/>
-
-  <property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
+  <import file="../build-common.xml"/>
 
   <path id="compile.class.path">
-    <fileset dir="${build.dir}/ivy/default"/>
-    <dirset dir="../build/classes"/>
+    <fileset dir="${build.dir}/ivy/lib/default" includes="*.jar"/>
   </path>
 
   <path id="test.class.path">
-    <path refid="compile.class.path"/>
-    <fileset dir="${build.dir}/ivy/test"/>
+    <fileset dir="${build.dir}/ivy/lib/test" includes="*.jar"/>
     <dirset dir="${basedir}/../build/test/classes"/>
     <dirset dir="${basedir}/build/classes"/>
     <dirset dir="${basedir}/build/test/classes"/>
-    <pathelement path="${clover.jar}"/>
   </path>
 
-  <!-- Ideally we would simply use the "default" Ivy configuration jars; however,
-  hcatalog-core.jar is not yet available at build-time so we must explicitly add it.
-  -->
   <path id="findbugs.class.path">
-    <fileset dir="${build.dir}/ivy/default"/>
-    <fileset dir="${basedir}/../build/hcatalog">
-      <include name="**/hcatalog-core-*.jar"/>
-    </fileset>
+    <fileset dir="${build.dir}/ivy/lib/default" includes="*.jar"/>
   </path>
 
 </project>

Modified: incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml (original)
+++ incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml Thu Aug  2 17:16:28 2012
@@ -26,24 +26,16 @@
 
   <configurations defaultconfmapping="default">
     <conf name="default"/>
-    <conf name="test" extends="default" visibility="private"/>
+    <conf name="test" extends="default"/>
   </configurations>
 
   <dependencies>
-    <dependency org="org.apache.hadoop" name="hadoop-core" rev="${hadoop.jars.version}"/>
-    <dependency org="org.apache.hive" name="hive-metastore" rev="${hive.version}"/>
-    <dependency org="org.apache.hive" name="hive-exec" rev="${hive.version}"/>
-    <dependency org="org.apache.hive" name="hive-builtins" rev="${hive.version}"/>
+    <dependency org="org.apache.hcatalog" name="hcatalog-core" rev="${hcatalog.version}"/>
     <dependency org="org.apache.pig" name="pig" rev="${pig.version}"/>
-    <dependency org="org.slf4j" name="slf4j-api" rev="${slf4j.version}"/>
-    <dependency org="org.slf4j" name="slf4j-log4j12" rev="${slf4j.version}"/>
 
-    <!-- Test dependencies -->
-    <dependency org="org.apache.hive" name="hive-builtins"
-      rev="${hive.version}" conf="test->default"/>
-    <dependency org="org.apache.hive" name="hive-cli"
-      rev="${hive.version}" conf="test->default"/>
-    <dependency org="org.apache.commons" name="commons-compress"
-      rev="${commons-compress.version}" conf="test->default"/>
+    <!-- test dependencies -->
+    <dependency org="junit" name="junit" rev="${junit.version}" conf="test->default"/>
+    <dependency org="org.apache.hadoop" name="hadoop-test" rev="${hadoop.jars.version}"
+      conf="test->default"/>
   </dependencies>
 </ivy-module>

Modified: incubator/hcatalog/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/ivy.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/ivy.xml (original)
+++ incubator/hcatalog/trunk/ivy.xml Thu Aug  2 17:16:28 2012
@@ -15,119 +15,56 @@
   limitations under the License. -->
 
 <ivy-module version="2.0">
-    <info organisation="org.apache.hcatalog" module="${ant.project.name}"
-            revision="${hcatalog.version}">
-        <license name="Apache 2.0"/>
-        <ivyauthor name="Apache HCatalog Team" url="http://incubator.apache.org/hcatalog"/>
-        <description>
-            Apache HCatalog
-        </description>
-    </info>
+  <info organisation="org.apache.hcatalog"
+        module="${ant.project.name}"
+        revision="${hcatalog.version}">
+    <license name="Apache 2.0"/>
+    <ivyauthor name="Apache HCatalog Team" url="http://incubator.apache.org/hcatalog"/>
+    <description>Apache HCatalog</description>
+  </info>
 
-    <configurations defaultconfmapping="default">
-    <!--these match the Maven configurations-->
-        <conf name="default" extends="master,runtime"/>
-        <conf name="master" description="contains the artifact but no dependencies"/>
-        <conf name="runtime" description="runtime but not the artifact" />
-        <conf name="common" visibility="private" 
-            extends="runtime"
-            description="artifacts needed to compile/test the application"/>
-        <conf name="test" visibility="private" extends="runtime"/>
-        <conf name="package" visibility="private" extends="master"/>
-        <conf name="releaseaudit" visibility="private"/>
-    </configurations>
+  <configurations defaultconfmapping="default">
+    <conf name="default"/>
+    <conf name="test" extends="default"/>
+  </configurations>
 
-    <publications>
-      <artifact name="hcatalog"/>
-      <artifact name="hcatalog-core"/>
-      <artifact name="hcatalog-server-extensions"/>
-    </publications>
+  <publications>
+    <artifact name="hcatalog"/>
+    <artifact name="hcatalog-core"/>
+    <artifact name="hcatalog-server-extensions"/>
+  </publications>
 
-    <dependencies>
-        <!-- needed to compile -->
-        <dependency org="org.antlr" name="antlr" rev="${antlr.version}"
-          conf="common->master" />
-        <dependency org="org.antlr" name="antlr-runtime" rev="${antlr.version}"
-          conf="common->master" />
-        <dependency org="org.apache.pig" name="pig" rev="${pig.version}"
-          conf="common->master" />
-        <dependency org="commons-cli" name="commons-cli" rev="${commons-cli.version}"
-          conf="common->master"/>
-        <dependency org="commons-lang" name="commons-lang" rev="${commons-lang.version}"
-          conf="common->master"/>
-        <dependency org="org.apache.hadoop" name="hadoop-tools"
-          rev="${hadoop.jars.version}" conf="common->master" />
-        <dependency org="org.apache.hadoop" name="hadoop-core"
-          rev="${hadoop.jars.version}" conf="default" />
-        <dependency org="org.apache.hadoop" name="hadoop-test"
-          rev="${hadoop.jars.version}" conf="common->master" />
-        <dependency org="javax.jms" name="jms" rev="${jms.version}"
-          conf="common->master" />
-        <dependency org="org.apache.activemq" name="activemq-core"
-          rev="${activemq.version}" conf="common->master" />
-        <dependency org="org.apache.activemq" name="kahadb"
-          rev="${activemq.version}" conf="common->master" />
-        <dependency org="javax.management.j2ee" name="management-api"
-          rev="${javax-mgmt.version}" conf="common->master" /> 
-        <dependency org="com.google.code.p.arat" name="rat-lib"
-          rev="${rats-lib.version}" conf="releaseaudit->default"/>
-        <dependency org="org.vafer" name="jdeb" rev="${jdeb.version}"
-          conf="package->master"/>
-        <dependency org="org.codehaus.jackson" name="jackson-mapper-asl"
-          rev="${jackson.version}" conf="common->master"/>
-        <dependency org="org.codehaus.jackson" name="jackson-core-asl"
-          rev="${jackson.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-metastore"
-          rev="${hive.version}" conf="default"/>
-        <dependency org="org.apache.hive" name="hive-common"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-exec"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-cli"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-hbase-handler"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.thrift" name="libfb303" rev="${fb303.version}"
-          conf="common->master"/>
-        <dependency org="junit" name="junit" rev="${junit.version}"
-          conf="common->master"/>
+  <dependencies>
+    <dependency org="org.apache.pig" name="pig" rev="${pig.version}"/>
+    <dependency org="org.apache.hadoop" name="hadoop-tools" rev="${hadoop.jars.version}" conf="default->*"/>
+    <dependency org="javax.jms" name="jms" rev="${jms.version}"/>
+    <dependency org="org.apache.activemq" name="activemq-core" rev="${activemq.version}">
+      <exclude org="org.springframework"/>
+    </dependency>
+    <dependency org="org.apache.activemq" name="kahadb" rev="${activemq.version}"/>
+    <dependency org="javax.management.j2ee" name="management-api" rev="${javax-mgmt.version}"/>
+    <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="${jackson.version}"/>
+    <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="${jackson.version}"/>
+    <dependency org="org.apache.hive" name="hive-builtins" rev="${hive.version}"/>
+    <dependency org="org.apache.hive" name="hive-metastore" rev="${hive.version}"/>
+    <dependency org="org.apache.hive" name="hive-common" rev="${hive.version}"/>
+    <dependency org="org.apache.hive" name="hive-exec" rev="${hive.version}"/>
+    <dependency org="org.apache.hive" name="hive-cli" rev="${hive.version}"/>
+    <dependency org="org.apache.hive" name="hive-hbase-handler" rev="${hive.version}">
+      <exclude org="org.apache.maven.plugins"/>
+      <exclude org="org.jruby"/>
+    </dependency>
+    <dependency org="org.apache.thrift" name="libfb303" rev="${fb303.version}"/>
+    <dependency org="commons-dbcp" name="commons-dbcp" rev="${commons-dbcp.version}">
+      <exclude module="commons-pool"/>
+      <exclude org="org.apache.geronimo.specs" module="geronimo-jta_1.1_spec"/>
+    </dependency>
 
-        <!-- needed to run-->
-        <dependency org="com.google.guava" name="guava" rev="${guava.version}"
-          conf="common->master"/>
-        <dependency org="org.slf4j" name="slf4j-api" rev="${slf4j.version}"
-          conf="common->master"/>
-        <dependency org="org.slf4j" name="slf4j-log4j12" rev="${slf4j.version}"
-          conf="common->master"/>
-        <dependency org="log4j" name="log4j" rev="${log4j.version}"
-          conf="common->master"/>
-        <dependency org="javax.jdo" name="jdo2-api" rev="${jdo.version}"
-          conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-core"
-          rev="${datanucleus-core.version}" conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-connectionpool"
-          rev="${datanucleus-connectionpool.version}" conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-enhancer"
-          rev="${datanucleus-enhancer.version}" conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-rdbms"
-          rev="${datanucleus-rdbms.version}" conf="default"/>
-        <dependency org="commons-dbcp" name="commons-dbcp" rev="${commons-dbcp.version}"
-            conf="common->master">
-          <exclude module="commons-pool" />
-          <exclude org="org.apache.geronimo.specs" module="geronimo-jta_1.1_spec"/>
-        </dependency>
-        <dependency org="commons-pool" name="commons-pool" rev="${commons-pool.version}"
-          conf="default"/>
-        <dependency org="org.apache.derby" name="derby" rev="${derby.version}"
-          conf="default"/>
-        <dependency org="commons-configuration" name="commons-configuration"
-          rev="${commons-configuration.version}" conf="default"/>
-        <dependency org="commons-httpclient" name="commons-httpclient"
-          rev="${commons-httpclient.version}" conf="default">
-          <exclude org="junit"/>
-        </dependency>
-        <dependency org="org.apache.hive" name="hive-builtins"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.commons" name="commons-compress" rev="${commons-compress.version}" conf="default"/>            
-    </dependencies>
+    <!-- test dependencies -->
+    <dependency org="junit" name="junit" rev="${junit.version}" conf="test->default"/>
+    <dependency org="org.vafer" name="jdeb" rev="${jdeb.version}" conf="test->default"/>
+    <dependency org="com.google.code.p.arat" name="rat-lib" rev="${rats-lib.version}" conf="test->default"/>
+    <dependency org="org.apache.hadoop" name="hadoop-test" rev="${hadoop.jars.version}" conf="test->default"/>
+    <dependency org="org.apache.maven" name="maven-ant-tasks" rev="${maven-ant-tasks.version}" conf="test->*"/>
+  </dependencies>
 </ivy-module>

Modified: incubator/hcatalog/trunk/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/ivy/libraries.properties?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/ivy/libraries.properties (original)
+++ incubator/hcatalog/trunk/ivy/libraries.properties Thu Aug  2 17:16:28 2012
@@ -53,6 +53,7 @@ jetty.webhcat.version=7.6.0.v20120127
 jms.version=1.1
 junit.version=4.10
 log4j.version=1.2.16
+maven-ant-tasks.version=2.1.3
 oro.version=2.0.8
 pig.version=0.8.0
 rats-lib.version=0.5.1

Added: incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestEximSemanticAnalysis.java.broken
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestEximSemanticAnalysis.java.broken?rev=1368604&view=auto
==============================================================================
--- incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestEximSemanticAnalysis.java.broken (added)
+++ incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestEximSemanticAnalysis.java.broken Thu Aug  2 17:16:28 2012
@@ -0,0 +1,174 @@
+/**
+ * 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.
+ */
+
+package org.apache.hcatalog.cli;
+
+import java.io.IOException;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.hive.cli.CliSessionState;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+import org.apache.hadoop.hive.metastore.Warehouse;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.ql.metadata.Hive;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse;
+import org.apache.hadoop.hive.ql.session.SessionState;
+import org.apache.hcatalog.MiniCluster;
+import org.apache.hcatalog.cli.SemanticAnalysis.HCatSemanticAnalyzer;
+import org.apache.hcatalog.common.HCatConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class TestEximSemanticAnalysis extends TestCase {
+
+  private final MiniCluster cluster = MiniCluster.buildCluster();
+  private HiveConf hcatConf;
+  private HCatDriver hcatDriver;
+  private Warehouse wh;
+  private static final Logger LOG = LoggerFactory.getLogger(TestEximSemanticAnalysis.class);
+
+  @Override
+  protected void setUp() throws Exception {
+
+    hcatConf = new HiveConf(this.getClass());
+    hcatConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, "");
+    hcatConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, "");
+    hcatConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
+    hcatConf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HCatSemanticAnalyzer.class.getName());
+    hcatConf.set("fs.pfile.impl", "org.apache.hadoop.fs.ProxyLocalFileSystem");
+    URI fsuri = cluster.getFileSystem().getUri();
+    Path whPath = new Path(fsuri.getScheme(), fsuri.getAuthority(), "/user/hive/warehouse");
+    hcatConf.set(HiveConf.ConfVars.HADOOPFS.varname, fsuri.toString());
+    hcatConf.set(ConfVars.METASTOREWAREHOUSE.varname, whPath.toString());
+    wh = new Warehouse(hcatConf);
+    SessionState.start(new CliSessionState(hcatConf));
+
+    hcatDriver = new HCatDriver();
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+  }
+
+  public void testExportPerms() throws IOException, MetaException, HiveException {
+
+    hcatDriver.run("drop table junit_sem_analysis");
+    CommandProcessorResponse response = hcatDriver
+        .run("create table junit_sem_analysis (a int) partitioned by (b string) stored as RCFILE");
+    assertEquals(0, response.getResponseCode());
+    Path whPath = wh.getTablePath(Hive.get(hcatConf).getDatabase("default"), "junit_sem_analysis");
+    cluster.getFileSystem().setPermission(whPath, FsPermission.valueOf("-rwxrwx-wx"));
+    cluster.getFileSystem().setOwner(whPath, "nosuchuser", "nosuchgroup");
+
+    Runtime.getRuntime().exec("rm -rf /tmp/hcat");
+    response = hcatDriver
+        .run("export table junit_sem_analysis to 'pfile://local:9080/tmp/hcat/exports/junit_sem_analysis'");
+
+    assertEquals(10, response.getResponseCode());
+    assertTrue("Permission denied expected : "+response.getErrorMessage(),
+        response.getErrorMessage().startsWith(
+            "FAILED: Error in semantic analysis: org.apache.hcatalog.common.HCatException : 3000 : Permission denied"));
+    Runtime.getRuntime().exec("rm -rf /tmp/hcat");
+    response = hcatDriver.run("drop table junit_sem_analysis");
+    if (response.getResponseCode() != 0) {
+      LOG.error(response.getErrorMessage());
+      fail("Drop table failed");
+    }
+  }
+
+  public void testImportPerms() throws IOException, MetaException, HiveException {
+
+    hcatDriver.run("drop table junit_sem_analysis");
+    CommandProcessorResponse response = hcatDriver
+        .run("create table junit_sem_analysis (a int) partitioned by (b string) stored as RCFILE");
+    assertEquals(0, response.getResponseCode());
+    Runtime.getRuntime().exec("rm -rf /tmp/hcat");
+    response = hcatDriver
+        .run("export table junit_sem_analysis to 'pfile://local:9080/tmp/hcat/exports/junit_sem_analysis'");
+    assertEquals(0, response.getResponseCode());
+    response = hcatDriver.run("drop table junit_sem_analysis");
+    assertEquals(0, response.getResponseCode());
+    response = hcatDriver
+        .run("create table junit_sem_analysis (a int) partitioned by (b string) stored as RCFILE");
+    assertEquals(0, response.getResponseCode());
+    Path whPath = wh.getTablePath(Hive.get(hcatConf).getDatabase("default"), "junit_sem_analysis");
+    cluster.getFileSystem().setPermission(whPath, FsPermission.valueOf("-rwxrwxr-x"));
+    cluster.getFileSystem().setOwner(whPath, "nosuchuser", "nosuchgroup");
+
+    response = hcatDriver
+        .run("import table junit_sem_analysis from 'pfile://local:9080/tmp/hcat/exports/junit_sem_analysis'");
+
+    assertEquals(10, response.getResponseCode());
+    assertTrue(
+        "Permission denied expected: "+response.getErrorMessage() ,
+        response.getErrorMessage().startsWith(
+            "FAILED: Error in semantic analysis: org.apache.hcatalog.common.HCatException : 3000 : Permission denied"));
+    Runtime.getRuntime().exec("rm -rf /tmp/hcat");
+
+    cluster.getFileSystem().setPermission(whPath, FsPermission.valueOf("-rwxrwxrwx"));
+    response = hcatDriver.run("drop table junit_sem_analysis");
+    if (response.getResponseCode() != 0) {
+        LOG.error(response.getErrorMessage());
+      fail("Drop table failed");
+    }
+  }
+
+  public void testImportSetPermsGroup() throws IOException, MetaException, HiveException {
+
+    hcatDriver.run("drop table junit_sem_analysis");
+    hcatDriver.run("drop table junit_sem_analysis_imported");
+    CommandProcessorResponse response = hcatDriver
+        .run("create table junit_sem_analysis (a int) partitioned by (b string) stored as RCFILE");
+    assertEquals(0, response.getResponseCode());
+    Runtime.getRuntime().exec("rm -rf /tmp/hcat");
+    response = hcatDriver
+        .run("export table junit_sem_analysis to 'pfile://local:9080/tmp/hcat/exports/junit_sem_analysis'");
+    assertEquals(0, response.getResponseCode());
+    response = hcatDriver.run("drop table junit_sem_analysis");
+    assertEquals(0, response.getResponseCode());
+
+    hcatConf.set(HCatConstants.HCAT_PERMS, "-rwxrw-r--");
+    hcatConf.set(HCatConstants.HCAT_GROUP, "nosuchgroup");
+
+    response = hcatDriver
+        .run("import table junit_sem_analysis_imported from 'pfile://local:9080/tmp/hcat/exports/junit_sem_analysis'");
+    assertEquals(0, response.getResponseCode());
+
+    Path whPath = wh.getTablePath(Hive.get(hcatConf).getDatabase("default"), "junit_sem_analysis_imported");
+    assertEquals(FsPermission.valueOf("-rwxrw-r--"), cluster.getFileSystem().getFileStatus(whPath).getPermission());
+    assertEquals("nosuchgroup", cluster.getFileSystem().getFileStatus(whPath).getGroup());
+
+    Runtime.getRuntime().exec("rm -rf /tmp/hcat");
+
+    response = hcatDriver.run("drop table junit_sem_analysis_imported");
+    if (response.getResponseCode() != 0) {
+      LOG.error(response.getErrorMessage());
+      fail("Drop table failed");
+    }
+  }
+
+
+}
+

Modified: incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestPermsGrp.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestPermsGrp.java?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestPermsGrp.java (original)
+++ incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestPermsGrp.java Thu Aug  2 17:16:28 2012
@@ -81,7 +81,7 @@ public class TestPermsGrp extends TestCa
 
     hcatConf = new HiveConf(this.getClass());
     hcatConf.set("hive.metastore.local", "false");
-    hcatConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + msPort);
+    hcatConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://127.0.0.1:" + msPort);
     hcatConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTRETRIES, 3);
 
     hcatConf.set(HiveConf.ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HCatSemanticAnalyzer.class.getName());

Modified: incubator/hcatalog/trunk/storage-handlers/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/build.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/build.xml (original)
+++ incubator/hcatalog/trunk/storage-handlers/build.xml Thu Aug  2 17:16:28 2012
@@ -28,6 +28,11 @@
         <ant target="${target}" dir="hbase" inheritAll="false" useNativeBasedir="true"/>
     </target>
 
+    <target name="ivy-report">
+        <antcall target="template">
+            <param name="target" value="_ivy-report"/>
+        </antcall>
+    </target>
 
     <target name="jar">
         <echo>Generating all handlers</echo>

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/build.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/build.xml (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/build.xml Thu Aug  2 17:16:28 2012
@@ -19,12 +19,9 @@
 
 
 <project name="hbase-storage-handler" default="jar" xmlns:ivy="antlib:org.apache.ivy.ant" >
-    <!--
-    ================================================================================
-    Import File
-    ================================================================================
-    -->
-    <import file="../../build-common.xml"/>
+
+    <property name="path.to.basedir" location="${basedir}/../.."/>
+    <loadproperties srcfile="${path.to.basedir}/build.properties"/>
 
     <!--
     ================================================================================
@@ -74,8 +71,6 @@
     <property name="test.output" value="no"/>
     <property name="hive.conf.dir" value="${hive.root}/conf"/>
 
-    <property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
-
     <!-- ivy properteis set here -->
     <property name="ivy.repo.dir" value="${user.home}/ivyrepo" />
     <property name="ivy.dir" location="../../ivy" />
@@ -90,10 +85,10 @@
               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.xml" location="${basedir}/ivy.xml"/>
     <property name="build.ivy.dir" location="${build.dir}/ivy" />
-    <property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib" />
-    <property name="ivy.lib.dir" location="${build.ivy.lib.dir}/${ant.project.name}"/>
     <property name="build.ivy.report.dir" location="${build.ivy.dir}/report" />
+    <property name="pom.file" location="${build.ivy.dir}/${ant.project.name}-${hcatalog.version}.pom"/>
 
     <!-- rats properties -->
     <property name="rat.reporting.classname" value="rat.Report"/>
@@ -101,92 +96,22 @@
     <!--this is the naming policy for artifacts we want pulled down-->
     <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[artifact]-[revision](-[classifier]).[ext]"/>
 
-    <!-- Classpaths for various builds -->
-    <path id="classpath">
-        <fileset dir="${ivy.lib.dir}" includes="*.jar"/>
-        <fileset dir="${hcatalog.dir}/build/hcatalog" includes=" *.jar"/>
-        <path refid="common.classpath"/>
+    <path id="compile.classpath">
+      <fileset dir="${build.dir}/ivy/lib/default">
+        <include name="**/*.jar"/>
+      </fileset>
     </path>
 
     <path id="test.classpath">
         <pathelement location="${test.build.classes}" />
         <pathelement location="${build.classes}" />
         <pathelement location="conf"/>
-        <fileset dir="${ivy.lib.dir}" includes="*.jar"/>
-        <fileset dir="${hcatalog.dir}/build/hcatalog" includes=" *.jar"/>
+        <fileset dir="${build.dir}/ivy/lib/test">
+          <include name="**/*.jar"/>
+        </fileset>
     </path>
 
-    <!--
-    ================================================================================
-    Ivy Section
-    ================================================================================
-    -->
-    <!-- Ivy goop stolen directly from Pig's build.xml -->
-    <target name="ivy-init-dirs">
-        <mkdir dir="${build.ivy.dir}" />
-        <mkdir dir="${build.ivy.lib.dir}" />
-        <mkdir dir="${build.ivy.report.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>
-
-    <!--
-       To avoid Ivy leaking things across big projects, always load Ivy in the same classloader.
-       Also note how we skip loading Ivy if it is already there, just to make sure all is well.
-    -->
-    <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'/>
-    </target>
-
-    <target name="ivy-compile" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for compile configuration">
-        <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="common"/>
-        <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-                      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="common"/>
-        <ivy:cachepath pathid="compile.classpath" conf="common"/>
-        <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="default"/>
-        <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-                      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
-                      conf="default"/>
-        <ivy:cachepath pathid="compile.classpath" conf="default"/>
-    </target>
-
-    <target name="ivy-releaseaudit" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for releaseaudit configuration">
-        <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="releaseaudit"/>
-        <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
-                      pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="releaseaudit"/>
-        <ivy:cachepath pathid="releaseaudit.classpath" conf="releaseaudit"/>
-    </target>
-
-    <target name="init" depends="ivy-compile" >
+    <target name="init" depends="ivy-retrieve">
         <mkdir dir="${dist.dir}" />
         <mkdir dir="${build.classes}" />
         <mkdir dir="${test.build.classes}" />
@@ -204,7 +129,7 @@
                source="${javac.version}" deprecation="${javac.deprecation}"
                includeantruntime="false">
             <compilerarg line="${javac.args}"/>
-            <classpath refid="classpath" />
+            <classpath refid="compile.classpath"/>
         </javac>
     </target>
 
@@ -296,15 +221,21 @@
     </target>
 
     <target name="javadoc" depends="jar" description="Create documentation">
-        <mkdir dir="${build.javadoc}" />
-        <javadoc packagenames="org.apache.hcatalog.*" destdir="${build.javadoc}" author="true" version="true" use="true"
-        windowtitle="HCatalog ${hcatalog.version} API" doctitle="HCatalog ${hcatalog.version} API" sourcepath="${src.dir}:${basedir}/src/gen-java">
-            <!--<packageset dir="${src.dir}" /> -->
-            <classpath>
-                <path refid="classpath" />
-            </classpath>
-            <group title="hcatalog" packages="org.apache.hcatalog.*" />
-        </javadoc>
+        <mkdir dir="${build.javadoc}"/>
+        <javadoc
+          packagenames="org.apache.hcatalog.*"
+          destdir="${build.javadoc}"
+          author="true"
+          version="true"
+          use="true"
+          windowtitle="HCatalog ${hcatalog.version} API"
+          doctitle="HCatalog ${hcatalog.version} API"
+          sourcepath="${src.dir}:${basedir}/src/gen-java">
+        <classpath>
+          <path refid="compile.classpath"/>
+        </classpath>
+        <group title="hcatalog" packages="org.apache.hcatalog.*"/>
+      </javadoc>
     </target>
 
 
@@ -346,4 +277,7 @@
             </fileset>
         </copy>
     </target>
+
+    <import file="../../ant/dependencies.xml"/>
+
 </project>

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/ivy.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/ivy.xml (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/ivy.xml Thu Aug  2 17:16:28 2012
@@ -15,111 +15,38 @@
   limitations under the License. -->
 
 <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
-    <info organisation="org.apache.hcatalog" module="${ant.project.name}"
-          revision="${hcatalog.version}">
-        <license name="Apache 2.0"/>
-        <ivyauthor name="Apache HCatalog Team" url="http://incubator.apache.org/hcatalog"/>
-        <description>
-            Apache HCatalog
-        </description>
-    </info>
-
-    <configurations defaultconfmapping="default">
-        <!--these match the Maven configurations-->
-        <conf name="default" extends="master,runtime"/>
-        <conf name="master" description="contains the artifact but no dependencies"/>
-        <conf name="runtime" description="runtime but not the artifact" />
-        <conf name="common" visibility="private"
-              extends="runtime"
-              description="artifacts needed to compile/test the application"/>
-        <conf name="test" visibility="private" extends="runtime"/>
-        <conf name="releaseaudit" visibility="private"/>
-    </configurations>
-    <dependencies>
-        <dependency org="org.apache.hbase" name="hbase" rev="${hbase.version}"
-                    conf="common->master">
-            <artifact name="hbase" type="jar" ext="jar"/>
-            <artifact name="hbase" type="test-jar" ext="jar" m:classifier="tests"/>
-        </dependency>
-        <dependency org="org.apache.zookeeper" name="zookeeper" rev="${zookeeper.version}"
-                    conf="common->master">
-            <artifact name="zookeeper" type="jar" ext="jar"/>
-            <artifact name="zookeeper" type="test-jar" ext="jar" m:classifier="tests"/>
-        </dependency>
-
-        <dependency org="org.apache.hadoop" name="hadoop-core"
-          rev="${hadoop.jars.version}" conf="common->master" />
-        <dependency org="org.apache.hadoop" name="hadoop-test"
-          rev="${hadoop.jars.version}" conf="common->master" />
-        <dependency org="org.apache.hive" name="hive-metastore"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-common"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-cli"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.apache.hive" name="hive-exec"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="junit" name="junit" rev="${junit.version}"
-          conf="common->master"/>
-        <dependency org="commons-lang" name="commons-lang" rev="${commons-lang.version}"
-          conf="common->master"/>
-        <dependency org="commons-io" name="commons-io" rev="${commons-io.version}"
-          conf="common->master"/>
-
-        <!-- hbase test dependencies -->
-        <dependency org="com.github.stephenc.high-scale-lib" name="high-scale-lib" rev="${high-scale-lib.version}" conf="common->master" />
-        <dependency org="com.google.guava" name="guava" rev="${guava.version}" conf="common->master" />
-        <dependency org="org.mortbay.jetty" name="jetty" rev="${jetty.version}" conf="common->master" />
-
-        <!-- needed to run tests -->
-        <dependency org="commons-configuration" name="commons-configuration"
-          rev="${commons-configuration.version}" conf="default"/>
-        <dependency org="org.codehaus.jackson" name="jackson-mapper-asl"
-          rev="${jackson.version}" conf="common->master"/>
-        <dependency org="org.codehaus.jackson" name="jackson-core-asl"
-          rev="${jackson.version}" conf="common->master"/>
-        <dependency org="org.slf4j" name="slf4j-api" rev="${slf4j.version}"
-          conf="common->master"/>
-        <dependency org="org.slf4j" name="slf4j-log4j12" rev="${slf4j.version}"
-          conf="common->master"/>
-        <dependency org="log4j" name="log4j" rev="${log4j.version}"
-          conf="common->master"/>
-        <dependency org="javax.jdo" name="jdo2-api" rev="${jdo.version}"
-          conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-core"
-          rev="${datanucleus-core.version}" conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-connectionpool"
-          rev="${datanucleus-connectionpool.version}" conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-enhancer"
-          rev="${datanucleus-enhancer.version}" conf="default"/>
-        <dependency org="org.datanucleus" name="datanucleus-rdbms"
-          rev="${datanucleus-rdbms.version}" conf="default"/>
-        <dependency org="commons-dbcp" name="commons-dbcp" rev="${commons-dbcp.version}"
-            conf="common->master">
-          <exclude module="commons-pool" />
-          <exclude org="org.apache.geronimo.specs" module="geronimo-jta_1.1_spec"/>
-        </dependency>
-        <dependency org="commons-pool" name="commons-pool" rev="${commons-pool.version}"
-          conf="default"/>
-        <dependency org="org.apache.derby" name="derby" rev="${derby.version}"
-          conf="default"/>
-        <dependency org="commons-configuration" name="commons-configuration"
-          rev="${commons-configuration.version}" conf="default"/>
-        <dependency org="commons-httpclient" name="commons-httpclient"
-          rev="${commons-httpclient.version}" conf="default"/>
-        <dependency org="org.apache.hive" name="hive-builtins"
-          rev="${hive.version}" conf="common->master"/>
-        <dependency org="org.mortbay.jetty" name="jetty"
-          rev="${jetty.version}" conf="default"/>
-        <dependency org="org.mortbay.jetty" name="jetty-util"
-          rev="${jetty.version}" conf="default"/>
-        <dependency org="org.apache.thrift" name="libfb303" rev="${fb303.version}"
-          conf="common->master"/>
-        <dependency org="org.antlr" name="antlr-runtime" rev="${antlr.version}"
-          conf="common->master" />
-        <dependency org="org.apache.hive" name="hive-hbase-handler"
-          rev="${hive.version}" conf="common->master"/>
-
- 
-    </dependencies>
+  <info organisation="org.apache.hcatalog"
+        module="${ant.project.name}"
+        revision="${hcatalog.version}">
+    <license name="Apache 2.0"/>
+    <ivyauthor name="Apache HCatalog Team" url="http://incubator.apache.org/hcatalog"/>
+    <description>Apache HCatalog</description>
+  </info>
+
+  <configurations defaultconfmapping="default">
+    <conf name="default"/>
+    <conf name="test" extends="default"/>
+  </configurations>
+
+  <dependencies>
+    <dependency org="org.apache.hcatalog" name="hcatalog-core" rev="${hcatalog.version}"/>
+    <dependency org="org.apache.hbase" name="hbase" rev="${hbase.version}"/>
+    <dependency org="org.apache.zookeeper" name="zookeeper" rev="${zookeeper.version}"/>
+
+    <!-- test dependencies -->
+    <dependency org="junit" name="junit" rev="${junit.version}" conf="test->default"/>
+    <dependency org="org.apache.hadoop" name="hadoop-test" rev="${hadoop.jars.version}"
+      conf="test->default"/>
+    <dependency org="org.apache.hbase" name="hbase" rev="${hbase.version}" conf="test->default">
+      <artifact name="hbase" type="jar" ext="jar"/>
+      <artifact name="hbase" type="test-jar" ext="jar" m:classifier="tests"/>
+    </dependency>
+    <dependency org="org.apache.zookeeper" name="zookeeper" rev="${zookeeper.version}"
+        conf="test->default">
+      <artifact name="zookeeper" type="jar" ext="jar"/>
+      <artifact name="zookeeper" type="test-jar" ext="jar" m:classifier="tests"/>
+    </dependency>
+    <dependency org="commons-io" name="commons-io" rev="${commons-io.version}"
+      conf="test->default"/>
+  </dependencies>
 </ivy-module>

Modified: incubator/hcatalog/trunk/webhcat/svr/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/build.xml?rev=1368604&r1=1368603&r2=1368604&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/build.xml (original)
+++ incubator/hcatalog/trunk/webhcat/svr/build.xml Thu Aug  2 17:16:28 2012
@@ -17,32 +17,23 @@
 -->
 
 <project name="webhcat">
-  <property name="path.to.basedir" value="${basedir}/../.."/>
-  
-  <import file="../../build-common-new.xml"/>
+  <property name="path.to.basedir" location="${basedir}/../.."/>
+
+  <import file="../../build-common.xml"/>
 
   <path id="compile.class.path">
-    <fileset dir="${build.dir}/ivy/default" includes="*.jar"/>
-    <fileset dir="${build.dir}/ivy/common" includes="*.jar"/>
+    <fileset dir="${build.dir}/ivy/lib/default" includes="*.jar"/>
   </path>
 
   <path id="test.class.path">
-    <dirset dir="${basedir}/../../build/test/classes"/>
+    <fileset dir="${build.dir}/ivy/lib/test" includes="*.jar"/>
+    <dirset dir="${path.to.basedir}/build/test/classes"/>
     <dirset dir="${basedir}/build/classes"/>
     <dirset dir="${basedir}/build/test/classes"/>
-    <fileset dir="${build.dir}/ivy/default" includes="*.jar"/>
-    <fileset dir="${build.dir}/ivy/common" includes="*.jar"/>
   </path>
 
-  <!-- Ideally we would simply use the "default" Ivy configuration jars; however,
-  hcatalog-core.jar is not yet available at build-time so we must explicitly add it.
-  -->
   <path id="findbugs.class.path">
-    <fileset dir="${build.dir}/ivy/default"/>
-    <fileset dir="${build.dir}/ivy/common"/>
-    <fileset dir="${basedir}/../../build/hcatalog">
-      <include name="**/hcatalog-core-*.jar"/>
-    </fileset>
+    <fileset dir="${build.dir}/ivy/lib/default" includes="*.jar"/>
   </path>
 
 </project>