Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed build file so it is possible to publish artifacts to local Mave…

…n repository
  • Loading branch information...
commit 25d6f911f74f8c1c95f7c955df6c9c4c9822cfaf 1 parent 3d19b14
Mark H. Butler authored
Showing with 42 additions and 13 deletions.
  1. +36 −11 build.xml
  2. +1 −1  ivy.xml
  3. +5 −1 ivy/libraries.properties
View
47 build.xml
@@ -19,7 +19,8 @@
-->
<project name="Hadoop-GPL-Compression" default="compile"
- xmlns:ivy="antlib:org.apache.ivy.ant">
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ xmlns:artifact="urn:maven-artifact-ant">
<!-- Load all the default properties, and any the user wants -->
<!-- to contribute (without having to type -D or edit this file -->
@@ -110,8 +111,14 @@
<property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]"/>
<!--this is how artifacts that get built are named-->
- <property name="ivy.publish.pattern" value="hadoop-[revision]-core.[ext]"/>
+ <property name="ivy.publish.pattern" value="${name}-[revision].[ext]"/>
<property name="jar.name" location="${build.dir}/${final.name}.jar" />
+ <property name="tsk.org" value="/org/apache/maven/maven-ant-tasks/"/>
+ <property name="ant_task.jar"
+ location="${ivy.dir}/maven-ant-tasks-${ant-task.version}.jar"/>
+ <property name="mvnrepo" value="http://repo2.maven.org/maven2"/>
+ <property name="ant_task_repo_url"
+ value="${mvnrepo}${tsk.org}${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
<!-- the normal classpath -->
<path id="classpath">
@@ -147,6 +154,10 @@
<pathelement location="${build.dir}"/>
</path>
+ <!-- ivy settings -->
+
+ <!-- <ivy:settings file="ivysettings.xml" /> -->
+
<!-- properties dependent on the items defined above. -->
<!--<available classname="${rat.reporting.classname}" classpathref="classpath" property="rat.present" value="true"/> -->
@@ -164,6 +175,17 @@
</sequential>
</macrodef>
+ <target name="ant-task-download" description="To download mvn-ant-task">
+ <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>
+
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
@@ -586,7 +608,7 @@
<ivy:publish
settingsRef="${ant.project.name}.ivy.settings"
resolver="local"
- pubrevision="${hadoop.version}"
+ pubrevision="${version}"
overwrite="true"
artifactspattern="${build.dir}/${ivy.publish.pattern}" />
</target>
@@ -598,7 +620,7 @@
<target name="makepom" depends="ivy-resolve">
<ivy:makepom settingsRef="${ant.project.name}.ivy.settings"
ivyfile="ivy.xml"
- pomfile="${build.ivy.maven.dir}/generated.pom">
+ pomfile="${build.ivy.maven.dir}/${final.name}.pom">
<ivy:mapping conf="default" scope="default"/>
<ivy:mapping conf="master" scope="master"/>
<ivy:mapping conf="runtime" scope="runtime"/>
@@ -607,12 +629,12 @@
<target name="copy-jar-to-maven" depends="ready-to-publish">
- <copy file="${hadoop.jar}"
- tofile="${build.ivy.maven.jar}"/>
- <checksum file="${build.ivy.maven.jar}" algorithm="md5"/>
+ <copy file="${jar.name}"
+ tofile="${build.ivy.maven.dir}/${final.name}.jar"/>
+ <checksum file="${build.ivy.maven.dir}/${final.name}.jar" algorithm="md5"/>
</target>
- <target name="copypom" depends="ivy-init-dirs">
+ <target name="copypom" depends="ivy-init-dirs,makepom">
<presetdef name="expandingcopy" >
<copy overwrite="true">
@@ -622,15 +644,18 @@
</copy>
</presetdef>
- <expandingcopy file="ivy/hadoop-core.pom"
+ <expandingcopy file="${build.ivy.maven.dir}/${final.name}.pom"
tofile="${build.ivy.maven.pom}"/>
<checksum file="${build.ivy.maven.pom}" algorithm="md5"/>
</target>
<target name="maven-artifacts" depends="copy-jar-to-maven,copypom" />
- <target name="published" depends="ivy-publish-local,maven-artifacts">
-
+ <target name="published" depends="mvn-taskdef,ivy-publish-local,maven-artifacts">
+ <artifact:pom file="${build.ivy.maven.pom}" id="hadoop.lzo.mvn.install"/>
+ <artifact:install file="${build.ivy.maven.dir}/${final.name}.jar">
+ <pom refid="hadoop.lzo.mvn.install"/>
+ </artifact:install>
</target>
</project>
View
2  ivy.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<ivy-module version="1.0">
- <info organisation="com.hadoop.gplcompression" module="${ant.project.name}">
+ <info organisation="com.hadoop.gplcompression" module="${ant.project.name}" revision="${version}">
<license name="GPL 3.0"/>
<ivyauthor name="Hadoop GPL Compression Team"
url="http://code.google.com/p/hadoop-gpl-compression/"/>
View
6 ivy/libraries.properties
@@ -8,5 +8,9 @@ hadoop.gpl.compression.version=0.1.0
commons-logging.version=1.0.4
commons-logging-api.version=1.0.4
#hadoop-core.version=0.20.0
-ivy.version=2.0.0-rc2
+ivy.version=2.2.0
junit.version=3.8.1
+log4j.version=1.2.15
+#hadoop.version=0.20.203.0
+ant-task.version=2.0.10
+
Please sign in to comment.
Something went wrong with that request. Please try again.