Thrift-363: Maven Deploy
Patch: jfarrell
Client lib: java
Adding the ability to publish the java client library as artifacts to the apache maven repository.
Usage: ant -Drelease=true publish
Note: You must have a gpg key setup and push it to pgp.mit.edu and
have a ~/.m2/settings.xml file containing your apache and gpg information.
Thrift-1114 will help make this file more secure or unnecessary.
<settings>
<servers>
<server>
<id>apache.releases.https</id>
<username>@APACHE_USERNAME@</username>
<password>@APACHE_PASSWORD@</password>
</server>
</servers>
<profiles>
<profile>
<id>gpg</id>
<properties>
<gpg.passphrase>@GPG_PASSPHRASE@</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1095216 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/build.properties b/lib/java/build.properties
new file mode 100644
index 0000000..c097cc1
--- /dev/null
+++ b/lib/java/build.properties
@@ -0,0 +1,126 @@
+thrift.version=0.7.0
+thrift.groupid=org.apache.thrift
+
+# Jar Versions
+mvn.ant.task.version=2.1.3
+
+# Local Install paths
+install.path=/usr/local/lib
+install.javadoc.path=${install.path}
+
+# Maven dependency download locations
+mvn.repo=http://repo1.maven.org/maven2
+apache.repo=https://repository.apache.org/content/repositories/releases
+mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
+mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
+
+# Apache Maven publish
+license=http://www.apache.org/licenses/LICENSE-2.0.txt"
+maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2
+maven-repository-id=apache.releases.https
+
+thrift.version=0.7.0
+thrift.groupid=org.apache.thrift
+
+# Jar Versions
+mvn.ant.task.version=2.1.3
+
+# Local Install paths
+install.path=/usr/local/lib
+install.javadoc.path=${install.path}
+
+# Maven dependency download locations
+mvn.repo=http://repo1.maven.org/maven2
+apache.repo=https://repository.apache.org/content/repositories/releases
+mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
+mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
+
+# Apache Maven publish
+license=http://www.apache.org/licenses/LICENSE-2.0.txt"
+maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2
+maven-repository-id=apache.releases.https
+
+thrift.version=0.7.0
+thrift.groupid=org.apache.thrift
+
+# Jar Versions
+mvn.ant.task.version=2.1.3
+
+# Local Install paths
+install.path=/usr/local/lib
+install.javadoc.path=${install.path}
+
+# Maven dependency download locations
+mvn.repo=http://repo1.maven.org/maven2
+apache.repo=https://repository.apache.org/content/repositories/releases
+mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
+mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
+
+# Apache Maven publish
+license=http://www.apache.org/licenses/LICENSE-2.0.txt"
+maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2
+maven-repository-id=apache.releases.https
+
+thrift.version=0.7.0
+thrift.groupid=org.apache.thrift
+
+# Jar Versions
+mvn.ant.task.version=2.1.3
+
+# Local Install paths
+install.path=/usr/local/lib
+install.javadoc.path=${install.path}
+
+# Maven dependency download locations
+mvn.repo=http://repo1.maven.org/maven2
+apache.repo=https://repository.apache.org/content/repositories/releases
+mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
+mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
+
+# Apache Maven publish
+license=http://www.apache.org/licenses/LICENSE-2.0.txt"
+maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2
+maven-repository-id=apache.releases.https
+
+thrift.version=0.7.0
+thrift.groupid=org.apache.thrift
+
+# Jar Versions
+mvn.ant.task.version=2.1.3
+
+# Local Install paths
+install.path=/usr/local/lib
+install.javadoc.path=${install.path}
+
+# Maven dependency download locations
+mvn.repo=http://repo1.maven.org/maven2
+apache.repo=https://repository.apache.org/content/repositories/releases
+mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
+mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
+
+# Apache Maven publish
+license=http://www.apache.org/licenses/LICENSE-2.0.txt"
+maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2
+maven-repository-id=apache.releases.https
+
+thrift.version=0.7.0
+thrift.groupid=org.apache.thrift
+
+# Jar Versions
+mvn.ant.task.version=2.1.3
+
+# Local Install paths
+install.path=/usr/local/lib
+install.javadoc.path=${install.path}
+
+# Maven dependency download locations
+mvn.repo=http://repo1.maven.org/maven2
+apache.repo=https://repository.apache.org/content/repositories/releases
+mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
+mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
+
+# Apache Maven publish
+license=http://www.apache.org/licenses/LICENSE-2.0.txt"
+maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2
+maven-repository-id=apache.releases.https
+
diff --git a/lib/java/build.xml b/lib/java/build.xml
index 096bfc7..cddf014 100644
--- a/lib/java/build.xml
+++ b/lib/java/build.xml
@@ -7,64 +7,47 @@
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
-
+
+ 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="libthrift" default="dist" basedir="."
- xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
-
+
<description>Thrift Build File</description>
<property name="thrift.root" location="../../"/>
- <property name="thrift.version" value="0.7.0"/>
- <property name="thrift.groupid" value="org.apache.thrift"/>
<property name="thrift.artifactid" value="libthrift"/>
-
- <property name="mvn.ant.task.version" value="2.1.1"/>
- <property name="ivy.version" value="2.2.0"/>
-
- <!-- Local install locations -->
- <property name="install.path" value="/usr/local/lib"/>
- <property name="install.javadoc.path" value="${install.path}"/>
- <!-- Dependency download location -->
- <property name="mvn.repo" value="http://repo1.maven.org/maven2"/>
- <property name="apache.repo" value="https://repository.apache.org/content/repositories/releases"/>
-
- <!-- Publish information-->
- <property name="license" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
- <property name="maven-repository-url" value="https://repository.apache.org/service/local/staging/deploy/maven2"/>
- <property name="maven-repository-id" value="apache.releases.https"/>
+ <!-- Include the base properties file -->
+ <property file="${basedir}/build.properties" />
<property environment="env"/>
<condition property="version" value="${thrift.version}">
<isset property="release"/>
</condition>
- <property name="version" value="${thrift.version}-snapshot"/>
+ <property name="version" value="${thrift.version}-snapshot"/>
<property name="final.name" value="${thrift.artifactid}-${version}"/>
- <property name="gen" location="gen-java"/>
- <property name="genbean" location="gen-javabean"/>
-
<property name="src" location="${basedir}/src"/>
<property name="build.dir" location="${basedir}/build"/>
<property name="build.lib.dir" location="${build.dir}/lib"/>
<property name="build.tools.dir" location="${build.dir}/tools"/>
<property name="src.test" location="test"/>
+ <property name="javadoc.dir" location="${build.dir}/javadoc"/>
<property name="build.test.dir" location="${build.dir}/test"/>
<property name="test.thrift.home" location="${thrift.root}/test"/>
- <property name="javadoc.dir" location="${build.dir}/javadoc"/>
-
+ <property name="gen" location="gen-java"/>
+ <property name="genbean" location="gen-javabean"/>
+
<property name="jar.file" location="${build.dir}/${final.name}.jar"/>
<property name="test.jar.file" location="${build.dir}/${final.name}-test.jar"/>
<property name="javadoc.jar.file" location="${build.dir}/${final.name}-javadoc.jar"/>
@@ -75,20 +58,11 @@
<property name="test.timeout" value="2000000"/>
<property name="test.src.dir" location="${basedir}/test"/>
<property name="test.log.dir" value="${build.test.dir}/log"/>
- <property name="test.port" value="9090"/>
-
- <!-- ivy properties -->
- <property name="ivy.repo.url" value="${mvn.repo}/org/apache/ivy/ivy/${ivy.version}/"/>
- <property name="ivy.jar" value="${build.tools.dir}/ivy-${ivy.version}.jar"/>
+ <property name="test.port" value="9090"/>
<!-- maven properties -->
- <property name="mvn.ant.task.url" value="${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}"/>
- <property name="mvn.ant.task.jar" location="${build.tools.dir}/maven-ant-tasks-${mvn.ant.task.version}.jar"/>
<property name="pom.xml" location="${build.dir}/${final.name}.pom"/>
- <!-- custom override anything with a thrift-build.properties file in your home directory -->
- <property file="${user.home}/.thrift-build.properties"/>
-
<path id="compile.classpath">
<fileset dir="${build.lib.dir}">
<include name="**/*.jar"/>
@@ -103,8 +77,8 @@
<pathelement location="${test.jar.file}"/>
</path>
- <!-- Tasks -->
- <target name="init" depends="setup.init,ivy.init,mvn.init" unless="init.finished">
+ <!-- Tasks -->
+ <target name="init" depends="setup.init,mvn.init" unless="init.finished">
<property name="init.finished" value="true"/>
</target>
@@ -116,35 +90,9 @@
<mkdir dir="${build.test.dir}"/>
</target>
- <target name="ivy.download" depends="setup.init" unless="ivy.found">
- <get src="${ivy.repo.url}/ivy-${ivy.version}.jar" dest="${ivy.jar}" usetimestamp="true"/>
- </target>
-
- <target name="ivy.check" description="check if ivy is in the classpath">
- <condition property="ivy.found">
- <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
- </condition>
- </target>
-
- <target name="ivy.init" depends="setup.init,ivy.check,ivy.download" 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 ${ivy.repo.url}. It could not be loaded from ${ivy.jar}
- </fail>
- </target>
-
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build.dir}" source="1.5" target="1.5"
- debug="true" classpathref="compile.classpath" includeantruntime="false"/>
+ debug="true" classpathref="compile.classpath" includeantruntime="false"/>
</target>
<target name="javadoc" depends="init">
@@ -183,7 +131,7 @@
<target name="install" depends="dist,javadoc">
<copy todir="${install.path}">
- <fileset dir="."><include name="*.jar"/></fileset>
+ <fileset dir="."><include name="*.jar"/></fileset>
</copy>
<copy todir="${install.javadoc.path}">
<fileset dir="${javadoc.dir}">
@@ -211,7 +159,7 @@
<target name="junit-test" description="Run the JUnit test suite" depends="compile-test">
<mkdir dir="${test.log.dir}"/>
<junit printsummary="true" showoutput="${test.output}" timeout="${test.timeout}"
- haltonfailure="no" errorProperty="tests.failed" failureProperty="tests.failed"
+ haltonfailure="true" errorProperty="tests.failed" failureProperty="tests.failed"
fork="true" forkmode="perTest" maxmemory="512m"
>
<sysproperty key="build.test" value="${build.test.dir}"/>
@@ -282,18 +230,18 @@
</target>
<target name="mvn.ant.tasks.download" depends="setup.init" unless="mvn.ant.tasks.found">
- <get src="${mvn.ant.task.url}/maven-ant-tasks-${mvn.ant.task.version}.jar" dest="${mvn.ant.task.jar}" usetimestamp="true"/>
+ <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/>
</target>
<target name="mvn.ant.tasks.check">
<condition property="mvn.ant.tasks.found">
<typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
</condition>
- </target>
+ </target>
<target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished">
<!-- Download mvn ant tasks, download dependencies, and setup pom file -->
- <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${mvn.ant.task.jar}"/>
+ <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/>
<!-- remote repositories used to download dependencies from -->
<artifact:remoteRepository id="central" url="${mvn.repo}"/>
@@ -332,6 +280,7 @@
<developer id="geechorama" name="Andrew McGeachie"/>
<developer id="molinaro" name="Anthony Molinaro"/>
<developer id="roger" name="Roger Meier"/>
+ <developer id="jfarrell" name="Jake Farrell"/>
<!-- Thrift dependencies list -->
<dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.5.8"/>