Author: rding
Date: Fri Aug 20 18:36:51 2010
New Revision: 987599

URL: http://svn.apache.org/viewvc?rev=987599&view=rev
Log:
PIG-1334: Make pig artifacts available through maven

Modified:
    hadoop/pig/trunk/CHANGES.txt
    hadoop/pig/trunk/build.xml
    hadoop/pig/trunk/ivy/libraries.properties
    hadoop/pig/trunk/ivy/pig.pom

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=987599&r1=987598&r2=987599&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Fri Aug 20 18:36:51 2010
@@ -26,6 +26,8 @@ PIG-1249: Safe-guards against misconfigu
 
 IMPROVEMENTS
 
+PIG-1334: Make pig artifacts available through maven (niraj via rding)
+
 PIG-1466: Improve log messages for memory usage (thejas)
 
 PIG-1404: added PigUnit, a framework fo building unit tests of Pig Latin 
scripts (romainr via gates)

Modified: hadoop/pig/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/build.xml?rev=987599&r1=987598&r2=987599&view=diff
==============================================================================
--- hadoop/pig/trunk/build.xml (original)
+++ hadoop/pig/trunk/build.xml Fri Aug 20 18:36:51 2010
@@ -15,7 +15,9 @@
    limitations under the License.
 -->
 
-<project name="Pig" default="jar" xmlns:ivy="antlib:org.apache.ivy.ant">
+<project name="Pig" default="jar" 
+       xmlns:artifact="urn:maven-artifact-ant"
+       xmlns:ivy="antlib:org.apache.ivy.ant">
     <!-- Load all the default properties, and any the user wants    -->
     <!-- to contribute (without having to type -D or edit this file -->
     <property file="${user.home}/build.properties" />
@@ -24,7 +26,9 @@
     <!-- name and version properties -->
     <property name="name" value="pig" />
     <property name="Name" value="Pig" />
-    <property name="version" value="0.8.0-dev" />
+       <property name="ant-task.version" value="2.0.10" />
+       <property name="pig.pom" value="${basedir}/ivy/pig.pom" />
+       <property name="version" value="0.8.0-SNAPSHOT" />
     <property name="final.name" value="${name}-${version}" />
     <condition property="isWindows">
         <os family="windows"/>
@@ -129,14 +133,24 @@
                <isset property="clover.present"/>
         </and>
     </condition>
-
+    <condition property="staging">
+        <equals arg1="${repo}" arg2="staging"/>
+    </condition>
     <!-- IVY properteis set here -->
+       <property name="ivy.repo.dir" value="${user.home}/ivyrepo" />
     <property name="ivy.dir" location="ivy" />
     <loadproperties srcfile="${ivy.dir}/libraries.properties"/>
     <property name="hadoop.jar" value="hadoop-core-${hadoop-core.version}.jar" 
/>
+       <property name="asfrepo" value="https://repository.apache.org"/>
+       <property name="asfsnapshotrepo" 
value="${asfrepo}/content/repositories/snapshots"/>
+       <property name="mvnrepo" value="http://repo2.maven.org/maven2"/>
+       <property name="asfstagingrepo" 
value="${asfrepo}/service/local/staging/deploy/maven2"/>
     <property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar"/>
+       <property name="ant_task.jar" 
location="${ivy.dir}/maven-ant-tasks-${ant-task.version}.jar"/>
+       <property name="ant_task_repo_url"
+       
value="${mvnrepo}/org/apache/maven/maven-ant-tasks/${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
+       <property name="ivy_repo_url" 
value="${mvnrepo}/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"/>
     <property name="guava.jar" value="guava-${guava.version}.jar"/>
-    <property name="ivy_repo_url" 
value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"/>
     <property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
     <property name="ivy.org" value="org.apache.pig"/>
     <property name="build.dir" location="build" />
@@ -146,17 +160,19 @@
     <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="build.ivy.maven.dir" location="${build.ivy.dir}/maven" />
+       <property name="pom.xml" location="${build.ivy.maven.dir}/pom.xml"/>
     <property name="build.ivy.maven.pom" 
location="${build.ivy.maven.dir}/pig-${version}.pom" />
-    <property name="build.ivy.maven.jar" 
location="${build.ivy.maven.dir}/pig-${version}.jar" />
+    <property name="build.ivy.maven.jar" 
location="${build.ivy.maven.dir}/pig-${version}-core.jar" />
     <property name="javacc.home" location="${ivy.lib.dir}" />
 
     <!--this is the naming policy for artifacts we want pulled down-->
     <property name="ivy.artifact.retrieve.pattern" 
value="${ant.project.name}/[artifact]-[revision].[ext]"/>
 
     <!--this is how artifacts that get built are named-->
-    <property name="ivy.publish.pattern" value="pig-[revision].[ext]"/>
-    <property name="pig.jar" value="${output.jarfile.core}"/>  
-   
+       <property name="ivy.publish.pattern" 
value="[artifact]-[revision].[ext]"/>
+       <property name="pig.jar" value="${output.jarfile}"/>
+       <property name="pig-core.jar" value="${output.jarfile.core}"/>  
+        <property name="pig-sources.jar" 
location="${build.dir}/${final.name}-sources.jar" />
 
     <!-- jdiff properties -->
     <property name="jdiff.jar" 
value="${ivy.lib.dir}/jdiff-${jdiff.version}.jar"/>
@@ -779,6 +795,84 @@
     <target name="check-for-findbugs">
        <available property="findbugs.present" 
file="${findbugs.home}/lib/findbugs.jar" />
     </target>
+    <target name="ant-task-download" description="To download mvn-ant-task" 
unless="offline">
+       <get src="${ant_task_repo_url}" dest="${ant_task.jar}" 
usetimestamp="true"/>
+    </target>
+    <target name="mvn-taskdef" depends="ant-task-download">
+      <path id="mvn-ant-task.classpath" path="${ant_task.jar}"/>
+      <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+          uri="urn:maven-artifact-ant"
+          classpathref="mvn-ant-task.classpath"/>
+    </target>
+    <target name="mvn-install" depends="mvn-taskdef,jar, source-jar"
+         description="To install pig to local filesystem's m2 cache">
+         <artifact:pom file="${pig.pom}" id="pig"/>
+          <artifact:install file="${pig-core.jar}">
+               <pom refid="pig"/>
+           <attach file="${output.jarfile.sources}" classifier="sources" />
+          </artifact:install>
+    </target>
+    <target name="mvn-deploy" depends="mvn-taskdef,jar,source-jar, 
signanddeploy, simpledeploy"
+         description="To deploy pig jar to apache snapshot's repository">
+    </target>
+
+     <target name="signanddeploy" if="staging" depends="sign">
+        <artifact:pom file="${pig.pom}" id="pig"/>
+        <artifact:install-provider artifactId="wagon-http" 
version="1.0-beta-2"/>
+        <artifact:deploy file="${pig-core.jar}">
+        <remoteRepository id="apache.staging.https" url="${asfstagingrepo}"/>
+        <pom refid="pig"/>
+          <attach file="${pig-core.jar}.asc" type="jar.asc"/>
+          <attach file="${pig.pom}.asc" type="pom.asc"/>
+           <attach file="${output.jarfile.sources}.asc" type="jar.asc" />
+          <attach file="${output.jarfile.sources}" classifier="sources" />
+        </artifact:deploy>
+    </target>
+
+    <target name="simpledeploy" unless="staging">
+      <artifact:pom file="${pig.pom}" id="pig"/>
+      <artifact:install-provider artifactId="wagon-http" version="1.0-beta-2"/>
+      <artifact:deploy file="${pig-core.jar}">
+              <remoteRepository id="apache.snapshots.https" 
url="${asfsnapshotrepo}"/>
+              <pom refid="pig"/>
+          <attach file="${pig-sources.jar}" classifier="sources" />
+      </artifact:deploy>
+   </target>
+       
+    <target name="sign" depends="clean-sign" if="staging">
+       <input message="password:>" addproperty="gpg.passphrase">
+        <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
+       </input>
+       <macrodef name="sign-artifact" description="Signs the artifact">
+         <attribute name="input.file"/>
+         <attribute name="output.file" default="@{input.file}.asc"/>
+         <attribute name="gpg.passphrase"/>
+         <sequential>
+           <echo>Signing @{input.file} Sig File: @{output.file}</echo>
+           <exec executable="gpg" >
+             <arg value="--armor"/>
+             <arg value="--output"/>
+             <arg value="@{output.file}"/>
+             <arg value="--passphrase"/>
+             <arg value="@{gpg.passphrase}"/>
+             <arg value="--detach-sig"/>
+             <arg value="@{input.file}"/>
+           </exec>
+         </sequential>
+       </macrodef>
+       <sign-artifact input.file="${pig-core.jar}"
+        output.file="${pig-core.jar}.asc" gpg.passphrase="${gpg.passphrase}"/>
+       <sign-artifact input.file="${output.jarfile.sources}"
+        output.file="${output.jarfile.sources}.asc" 
gpg.passphrase="${gpg.passphrase}"/>
+       <sign-artifact input.file="${pig.pom}"
+       output.file="${pig.pom}.asc" gpg.passphrase="${gpg.passphrase}"/>
+     </target>
+
+     <target name="clean-sign" description="Clean.  Delete .asc files">
+       <delete>
+         <fileset dir="." includes="**/**/*.asc"/>
+       </delete>
+     </target>
 
     <!-- ================================================================== -->
     <!-- Perform audit activities for the release                           -->
@@ -1085,7 +1179,7 @@
      </target>
 
      <target name="copy-jar-to-maven" depends="ready-to-publish">
-        <copy file="${pig.jar}" tofile="${build.ivy.maven.jar}"/>
+        <copy file="${pig-core.jar}" tofile="${build.ivy.maven.jar}"/>
         <checksum file="${build.ivy.maven.jar}" algorithm="md5"/>
      </target>
 

Modified: hadoop/pig/trunk/ivy/libraries.properties
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/ivy/libraries.properties?rev=987599&r1=987598&r2=987599&view=diff
==============================================================================
--- hadoop/pig/trunk/ivy/libraries.properties (original)
+++ hadoop/pig/trunk/ivy/libraries.properties Fri Aug 20 18:36:51 2010
@@ -16,6 +16,7 @@
 #These are the versions of our dependencies (in alphabetical order)
 apacheant.version=1.7.1
 antlr.version=2.7.6
+pig.version=0.8.0
 
 commons-beanutils.version=1.7.0
 commons-cli.version=1.0

Modified: hadoop/pig/trunk/ivy/pig.pom
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/ivy/pig.pom?rev=987599&r1=987598&r2=987599&view=diff
==============================================================================
--- hadoop/pig/trunk/ivy/pig.pom (original)
+++ hadoop/pig/trunk/ivy/pig.pom Fri Aug 20 18:36:51 2010
@@ -20,10 +20,10 @@
   -->
 
   <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.pig</groupId>
+  <groupId>org.apache.hadoop</groupId>
   <artifactId>pig</artifactId>
   <packaging>jar</packaging>
-  <version>${pig.version}</version>
+  <version>0.8.0-SNAPSHOT</version>
   <description>
     Pig is a platform for analyzing large data sets that consists of a 
high-level 
     language for expressing data analysis programs, coupled with 
infrastructure 
@@ -45,6 +45,7 @@
           <groupId>com.jcraft</groupId>
           <artifactId>zlib</artifactId>
         </exclusion>
+       </exclusions>
     </dependency>
 
     <dependency>
@@ -98,7 +99,7 @@
        <dependency>
            <groupId>org.python</groupId>
            <artifactId>jython</artifactId>
-           <version>${jython.version}/version>
+           <version>${jython.version}</version>
        </dependency>
     <dependency>
         <groupId>com.google.guava</groupId>


Reply via email to