summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-04-19 11:24:31 +0000
committerRobert Gemmell <robbie@apache.org>2011-04-19 11:24:31 +0000
commit39edbbb95807d9775d7c54044e859115cb904774 (patch)
tree5908af71c2df5683ce61aed709d228ad3562f50b
parent6c904379b3ba82dd5d5b46723363f51e5770e17f (diff)
downloadqpid-python-39edbbb95807d9775d7c54044e859115cb904774.tar.gz
QPID-3213: add ant+ivy task for uploading the client+common mavent artifacts to a staging repo in the ASF Nexus instance
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1095038 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--.gitignore1
-rw-r--r--qpid/java/ivy.xml39
-rw-r--r--qpid/java/ivysettings-nexus.xml30
-rw-r--r--qpid/java/lib/ivy/README.txt11
-rw-r--r--qpid/java/upload.xml68
5 files changed, 149 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index f64d5fd8e4..09e658593c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,6 +55,7 @@ generated/
target
qpid/java/lib/cobertura
qpid/java/lib/findbugs
+qpid/java/lib/ivy
# Intellij Project files
*.iml
*.ipr
diff --git a/qpid/java/ivy.xml b/qpid/java/ivy.xml
new file mode 100644
index 0000000000..cdffcff458
--- /dev/null
+++ b/qpid/java/ivy.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
+
+ <info organisation="org/apache" module="qpid" revision="0.10"/>
+
+ <publications xmlns:e="urn:ant.apache.org:ivy-extras">
+ <artifact name="qpid-client" type="pom" ext="pom"/>
+ <artifact name="qpid-client" type="pom.asc" ext="pom.asc"/>
+ <artifact name="qpid-client" type="jar" ext="jar"/>
+ <artifact name="qpid-client" type="jar.asc" ext="jar.asc"/>
+ <artifact name="qpid-client" type="source" ext="jar" e:classifier="sources"/>
+ <artifact name="qpid-client" type="source.asc" ext="jar.asc" e:classifier="sources"/>
+ <artifact name="qpid-common" type="pom" ext="pom"/>
+ <artifact name="qpid-common" type="pom.asc" ext="pom.asc"/>
+ <artifact name="qpid-common" type="jar" ext="jar"/>
+ <artifact name="qpid-common" type="jar.asc" ext="jar.asc"/>
+ <artifact name="qpid-common" type="source" ext="jar" e:classifier="sources"/>
+ <artifact name="qpid-common" type="source.asc" ext="jar.asc" e:classifier="sources"/>
+ </publications>
+
+ <dependencies/>
+</ivy-module>
diff --git a/qpid/java/ivysettings-nexus.xml b/qpid/java/ivysettings-nexus.xml
new file mode 100644
index 0000000000..1d9c393e23
--- /dev/null
+++ b/qpid/java/ivysettings-nexus.xml
@@ -0,0 +1,30 @@
+<!--
+ 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.
+-->
+<ivysettings>
+ <credentials host="${nexus.host}" realm="Sonatype Nexus Repository Manager" username="${nexus.user}" passwd="${nexus.password}"/>
+ <caches defaultCacheDir="${user.home}/.ivy2/cache"/>
+ <resolvers>
+ <ibiblio name="public" m2compatible="true"/>
+ <url name="nexus">
+ <artifact pattern="${nexus.upload.url}/[organisation]/[module]/[artifact]/[revision]/[artifact]-[revision](-[classifier]).[ext]" />
+ </url>
+ </resolvers>
+ <modules>
+ <module organisation="${nexus.organisation}" name="qpid" resolver="nexus"/>
+ </modules>
+ <settings defaultResolver="public"/>
+</ivysettings>
diff --git a/qpid/java/lib/ivy/README.txt b/qpid/java/lib/ivy/README.txt
new file mode 100644
index 0000000000..f8a01f39b4
--- /dev/null
+++ b/qpid/java/lib/ivy/README.txt
@@ -0,0 +1,11 @@
+Folder used to store Ivy libs for use in publishing Maven artifacts.
+
+Ivy must be downloaded and extracted into this directory if it is not available in the Ant lib dir.
+
+File may be downloaded in 2 ways:
+1. By running the following command from the qpid/java dir:
+ ant -buildfile upload.xml download-ivy
+2. Manually download and extract via http://ant.apache.org/ivy.
+
+Note for method 1 you may also have to set proxy server settings in advance, eg:
+export ANT_OPTS="-Dhttp.proxyHost=<hostname> -Dhttp.proxyPort=<port>"
diff --git a/qpid/java/upload.xml b/qpid/java/upload.xml
new file mode 100644
index 0000000000..abc58d9f97
--- /dev/null
+++ b/qpid/java/upload.xml
@@ -0,0 +1,68 @@
+<?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 name="upload" default="upload" xmlns:ivy="antlib:org.apache.ivy.ant">
+ <description>Targets for uploading releases to ASF's Nexus instance</description>
+
+ <property name="nexus.organisation" value="org.apache"/>
+ <property name="nexus.host" value="repository.apache.org"/>
+ <property name="nexus.upload.url" value="https://repository.apache.org/service/local/staging/deploy/maven2"/>
+
+ <!-- properties for downloading ivy if required -->
+ <property name="ivy.jar.dir" value="lib/ivy" />
+ <property name="ivy.install.version" value="2.2.0" />
+ <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" />
+ <property name="ivy.repo.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy"/>
+
+ <target name="download-ivy">
+ <mkdir dir="${ivy.jar.dir}"/>
+ <!-- download Ivy from web site so that it can be used without any special installation -->
+ <echo message="Downloading ivy..."/>
+ <get src="${ivy.repo.url}/${ivy.install.version}/ivy-${ivy.install.version}.jar"
+ dest="${ivy.jar.file}" usetimestamp="true"/>
+ </target>
+
+ <target name="load-ivy">
+ <!-- Try to load Ivy from local ivy dir, in case the user has not already dropped it into
+ Ant's lib dir (note that the latter copy will always take precedence). Won't
+ fail so long as Ivy is in at least one of the locations. -->
+ <mkdir dir="${ivy.jar.dir}"/>
+ <path id="ivy.lib.path">
+ <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+ </path>
+ <taskdef resource="org/apache/ivy/ant/antlib.xml"
+ uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
+ </target>
+
+ <!-- check the following properties which must be specified by the user-->
+ <target name="check-props-exist" description="check that the required properties have been set">
+ <fail unless="nexus.user" message="You must supply the 'nexus.user' property"/>
+ <fail unless="nexus.password" message="You must supply the 'nexus.password' property"/>
+ <fail unless="maven.artifact.dir" message="You must supply the 'maven.artifact.dir' property"/>
+ </target>
+
+ <target name="perform-nexus-upload" description="really requires the prepare-upload target to be run first">
+ <ivy:configure file="ivysettings-nexus.xml"/>
+ <ivy:resolve file="ivy.xml"/>
+ <ivy:retrieve/>
+ <ivy:deliver/>
+ <ivy:publish publishivy="false" resolver="nexus"
+ artifactspattern="${maven.artifact.dir}/[organisation]/[module]/[artifact]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
+ </target>
+
+ <target name="upload" depends="load-ivy, check-props-exist, perform-nexus-upload"/>
+</project>