Skip to content
This repository

Fixed build so it is possible to publish artifacts to local Maven repository #31

Merged
merged 2 commits into from over 2 years ago

3 participants

Mark H. Butler Michael G. Noll Raghu Angadi
Mark H. Butler

Second attempt, removed the hadoop-core.version and hadoop.version for libraries.properties.

Michael G. Noll

Any chance that this change will be merged into hadoop-lzo?

We are already using this patch in our continuous build of EB for several weeks now (Mark is in our team).

Raghu Angadi rangadi merged commit 6bb1b7f into from January 10, 2012
Raghu Angadi rangadi closed this January 10, 2012
Benoit Perroud killerwhile referenced this pull request from a commit September 18, 2012
Benoit Perroud Merge twitter/hadoop-lzo pull request #31 (#31) into pull-31-mavenized
Conflicts:
	ivy/libraries.properties
f43d5ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Aug 29, 2011
Fixed build file so it is possible to publish artifacts to local Mave…
…n repository
25d6f91
Sep 06, 2011
Removed Hadoop version numbers as they are not used dcb0dbc
This page is out of date. Refresh to see the latest.
47  build.xml
@@ -19,7 +19,8 @@
19 19
 -->
20 20
 
21 21
 <project name="Hadoop-GPL-Compression" default="compile"
22  
-   xmlns:ivy="antlib:org.apache.ivy.ant"> 
  22
+   xmlns:ivy="antlib:org.apache.ivy.ant"
  23
+   xmlns:artifact="urn:maven-artifact-ant"> 
23 24
 
24 25
   <!-- Load all the default properties, and any the user wants    -->
25 26
   <!-- to contribute (without having to type -D or edit this file -->
@@ -110,8 +111,14 @@
110 111
   <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]"/>
111 112
 
112 113
   <!--this is how artifacts that get built are named-->
113  
-  <property name="ivy.publish.pattern" value="hadoop-[revision]-core.[ext]"/>
  114
+  <property name="ivy.publish.pattern" value="${name}-[revision].[ext]"/>
114 115
   <property name="jar.name" location="${build.dir}/${final.name}.jar" />
  116
+  <property name="tsk.org" value="/org/apache/maven/maven-ant-tasks/"/>
  117
+  <property name="ant_task.jar" 
  118
+    location="${ivy.dir}/maven-ant-tasks-${ant-task.version}.jar"/>
  119
+  <property name="mvnrepo" value="http://repo2.maven.org/maven2"/>
  120
+  <property name="ant_task_repo_url"
  121
+    value="${mvnrepo}${tsk.org}${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
115 122
 
116 123
   <!-- the normal classpath -->
117 124
   <path id="classpath">
@@ -147,6 +154,10 @@
147 154
     <pathelement location="${build.dir}"/>
148 155
   </path>
149 156
 
  157
+  <!-- ivy settings -->
  158
+
  159
+ <!-- <ivy:settings file="ivysettings.xml" /> -->
  160
+
150 161
   <!-- properties dependent on the items defined above. -->
151 162
   <!--<available classname="${rat.reporting.classname}" classpathref="classpath" property="rat.present" value="true"/> -->
152 163
 
@@ -164,6 +175,17 @@
164 175
     </sequential>
165 176
   </macrodef>
166 177
 
  178
+  <target name="ant-task-download" description="To download mvn-ant-task">
  179
+    <get src="${ant_task_repo_url}" dest="${ant_task.jar}" usetimestamp="true"/>
  180
+  </target>
  181
+
  182
+  <target name="mvn-taskdef" depends="ant-task-download">
  183
+     <path id="mvn-ant-task.classpath" path="${ant_task.jar}"/>
  184
+     <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
  185
+         uri="urn:maven-artifact-ant"
  186
+         classpathref="mvn-ant-task.classpath"/>
  187
+  </target>  
  188
+
167 189
   <!-- ====================================================== -->
168 190
   <!-- Stuff needed by all targets                            -->
169 191
   <!-- ====================================================== -->
@@ -586,7 +608,7 @@
586 608
     <ivy:publish
587 609
       settingsRef="${ant.project.name}.ivy.settings"
588 610
       resolver="local"
589  
-      pubrevision="${hadoop.version}"
  611
+      pubrevision="${version}"
590 612
       overwrite="true"
591 613
       artifactspattern="${build.dir}/${ivy.publish.pattern}" />
592 614
   </target>
@@ -598,7 +620,7 @@
598 620
   <target name="makepom" depends="ivy-resolve">
599 621
     <ivy:makepom settingsRef="${ant.project.name}.ivy.settings"
600 622
       ivyfile="ivy.xml"
601  
-      pomfile="${build.ivy.maven.dir}/generated.pom">
  623
+      pomfile="${build.ivy.maven.dir}/${final.name}.pom">
602 624
       <ivy:mapping conf="default" scope="default"/>
603 625
       <ivy:mapping conf="master" scope="master"/>
604 626
       <ivy:mapping conf="runtime" scope="runtime"/>
@@ -607,12 +629,12 @@
607 629
 
608 630
 
609 631
   <target name="copy-jar-to-maven" depends="ready-to-publish">
610  
-    <copy file="${hadoop.jar}"
611  
-      tofile="${build.ivy.maven.jar}"/>
612  
-    <checksum file="${build.ivy.maven.jar}" algorithm="md5"/>
  632
+    <copy file="${jar.name}"
  633
+      tofile="${build.ivy.maven.dir}/${final.name}.jar"/>
  634
+    <checksum file="${build.ivy.maven.dir}/${final.name}.jar" algorithm="md5"/>
613 635
   </target>
614 636
 
615  
-  <target name="copypom" depends="ivy-init-dirs">
  637
+  <target name="copypom" depends="ivy-init-dirs,makepom">
616 638
 
617 639
    <presetdef name="expandingcopy" >
618 640
     <copy overwrite="true">
@@ -622,15 +644,18 @@
622 644
     </copy>
623 645
    </presetdef>
624 646
 
625  
-   <expandingcopy file="ivy/hadoop-core.pom"
  647
+   <expandingcopy file="${build.ivy.maven.dir}/${final.name}.pom"
626 648
       tofile="${build.ivy.maven.pom}"/>
627 649
    <checksum file="${build.ivy.maven.pom}" algorithm="md5"/>
628 650
   </target>
629 651
 
630 652
   <target name="maven-artifacts" depends="copy-jar-to-maven,copypom" />
631 653
 
632  
-  <target name="published" depends="ivy-publish-local,maven-artifacts">
633  
-
  654
+  <target name="published" depends="mvn-taskdef,ivy-publish-local,maven-artifacts">
  655
+     <artifact:pom file="${build.ivy.maven.pom}" id="hadoop.lzo.mvn.install"/>
  656
+     <artifact:install file="${build.ivy.maven.dir}/${final.name}.jar">
  657
+        <pom refid="hadoop.lzo.mvn.install"/>
  658
+     </artifact:install>
634 659
   </target>
635 660
 
636 661
 </project>
2  ivy.xml
... ...
@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" ?>
2 2
 <ivy-module version="1.0">
3  
-  <info organisation="com.hadoop.gplcompression" module="${ant.project.name}">
  3
+  <info organisation="com.hadoop.gplcompression" module="${ant.project.name}" revision="${version}">
4 4
     <license name="GPL 3.0"/>
5 5
     <ivyauthor name="Hadoop GPL Compression Team" 
6 6
                url="http://code.google.com/p/hadoop-gpl-compression/"/>
6  ivy/libraries.properties
@@ -7,6 +7,8 @@ hadoop.gpl.compression.version=0.1.0
7 7
 #These are the versions of our dependencies (in alphabetical order)
8 8
 commons-logging.version=1.0.4
9 9
 commons-logging-api.version=1.0.4
10  
-#hadoop-core.version=0.20.0
11  
-ivy.version=2.0.0-rc2
  10
+ivy.version=2.2.0
12 11
 junit.version=3.8.1
  12
+log4j.version=1.2.15
  13
+ant-task.version=2.0.10
  14
+
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.