blob: 800258482b527a6cf53654a3ee9a28bdef296118 [file] [log] [blame]
David Reiss36a5a252009-04-29 23:20:56 +00001<?xml version="1.0"?>
David Reissea2cba82009-03-30 21:35:00 +00002<!--
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
Jake Farrell4b8faf92011-04-19 21:11:54 +000010
11 http://www.apache.org/licenses/LICENSE-2.0
12
David Reissea2cba82009-03-30 21:35:00 +000013 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
Jake Farrell4b8faf92011-04-19 21:11:54 +000019 -->
David Reiss36a5a252009-04-29 23:20:56 +000020<project name="libthrift" default="dist" basedir="."
Bryan Duxbury547edc72010-03-28 21:02:38 +000021 xmlns:artifact="antlib:org.apache.maven.artifact.ant">
Jake Farrell4b8faf92011-04-19 21:11:54 +000022
Mark Slee83c52a82006-06-07 06:51:18 +000023 <description>Thrift Build File</description>
Bryan Duxbury2f45e782009-08-20 00:55:12 +000024 <property name="thrift.root" location="../../"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000025 <property name="thrift.artifactid" value="libthrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000026
Jake Farrell4b8faf92011-04-19 21:11:54 +000027 <!-- Include the base properties file -->
28 <property file="${basedir}/build.properties" />
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000029
30 <property environment="env"/>
31
32 <condition property="version" value="${thrift.version}">
33 <isset property="release"/>
34 </condition>
Jake Farrell4b8faf92011-04-19 21:11:54 +000035 <property name="version" value="${thrift.version}-snapshot"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000036
37 <property name="final.name" value="${thrift.artifactid}-${version}"/>
38
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000039 <property name="src" location="${basedir}/src"/>
40 <property name="build.dir" location="${basedir}/build"/>
41 <property name="build.lib.dir" location="${build.dir}/lib"/>
42 <property name="build.tools.dir" location="${build.dir}/tools"/>
43 <property name="src.test" location="test"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +000044 <property name="javadoc.dir" location="${build.dir}/javadoc"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000045 <property name="build.test.dir" location="${build.dir}/test"/>
46 <property name="test.thrift.home" location="${thrift.root}/test"/>
47
Jake Farrell4b8faf92011-04-19 21:11:54 +000048 <property name="gen" location="gen-java"/>
49 <property name="genbean" location="gen-javabean"/>
50
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000051 <property name="jar.file" location="${build.dir}/${final.name}.jar"/>
52 <property name="test.jar.file" location="${build.dir}/${final.name}-test.jar"/>
53 <property name="javadoc.jar.file" location="${build.dir}/${final.name}-javadoc.jar"/>
54 <property name="source.tar.gz" location="${build.dir}/${final.name}-src.tar.gz"/>
55
56 <!-- Junit properties -->
57 <property name="test.junit.output.format" value="plain"/>
58 <property name="test.timeout" value="2000000"/>
59 <property name="test.src.dir" location="${basedir}/test"/>
60 <property name="test.log.dir" value="${build.test.dir}/log"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +000061 <property name="test.port" value="9090"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000062
63 <!-- maven properties -->
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000064 <property name="pom.xml" location="${build.dir}/${final.name}.pom"/>
65
David Reiss36a5a252009-04-29 23:20:56 +000066 <path id="compile.classpath">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000067 <fileset dir="${build.lib.dir}">
68 <include name="**/*.jar"/>
69 </fileset>
David Reiss36a5a252009-04-29 23:20:56 +000070 </path>
71
72 <path id="test.classpath">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000073 <path refid="compile.classpath"/>
74 <pathelement path="${env.CLASSPATH}"/>
75 <pathelement location="${build.test.dir}"/>
76 <pathelement location="${jar.file}"/>
77 <pathelement location="${test.jar.file}"/>
David Reiss36a5a252009-04-29 23:20:56 +000078 </path>
Bryan Duxbury538e3442009-02-10 04:49:39 +000079
Jake Farrell4b8faf92011-04-19 21:11:54 +000080 <!-- Tasks -->
81 <target name="init" depends="setup.init,mvn.init" unless="init.finished">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000082 <property name="init.finished" value="true"/>
Mark Slee83c52a82006-06-07 06:51:18 +000083 </target>
84
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000085 <target name="setup.init">
86 <tstamp/>
87 <mkdir dir="${build.dir}"/>
88 <mkdir dir="${build.lib.dir}"/>
89 <mkdir dir="${build.tools.dir}"/>
90 <mkdir dir="${build.test.dir}"/>
David Reiss36a5a252009-04-29 23:20:56 +000091 </target>
92
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000093 <target name="compile" depends="init">
94 <javac srcdir="${src}" destdir="${build.dir}" source="1.5" target="1.5"
Bryan Duxburybce6fad2011-08-24 00:22:30 +000095 debug="true" classpathref="compile.classpath" includeantruntime="false">
96 <compilerarg value="-Xlint:deprecation"/>
97 </javac>
David Reiss36a5a252009-04-29 23:20:56 +000098 </target>
99
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000100 <target name="javadoc" depends="init">
101 <javadoc sourcepath="${src}" destdir="${javadoc.dir}"
102 version="true" windowtitle="Thrift Java API" doctitle="Thrift Java API"
Bryan Duxburyd8c77572010-07-29 19:30:47 +0000103 classpathref="test.classpath">
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000104 </javadoc>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000105 <jar jarfile="${javadoc.jar.file}" basedir="${javadoc.dir}">
106 <manifest>
107 <attribute name="Implementation-Version" value="${version}"/>
108 </manifest>
109 </jar>
Mark Slee83c52a82006-06-07 06:51:18 +0000110 </target>
111
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000112 <target name="dist" depends="compile">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000113 <mkdir dir="${build.dir}/META-INF"/>
114 <copy file="${thrift.root}/LICENSE" tofile="${build.dir}/META-INF/LICENSE.txt"/>
115 <copy file="${thrift.root}/NOTICE" tofile="${build.dir}/META-INF/NOTICE.txt"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000116 <jar jarfile="${jar.file}">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000117 <manifest>
118 <attribute name="Implementation-Version" value="${version}"/>
119 </manifest>
120 <fileset dir="${build.dir}">
121 <include name="org/apache/thrift/**/*.class"/>
122 <include name="META-INF/*.txt"/>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000123 </fileset>
124 <fileset dir="src">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000125 <include name="**/*.java"/>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000126 </fileset>
127 </jar>
128 </target>
129
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000130 <target name="pack.src">
131 <tar destfile="${source.tar.gz}" basedir="${src}" compression="gzip"/>
132 </target>
133
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000134 <target name="install" depends="dist,javadoc">
David Reiss56c2c212009-06-04 02:05:25 +0000135 <copy todir="${install.path}">
Jake Farrell73b8dfc2011-06-02 16:13:18 +0000136 <fileset dir="${build.dir}" includes="*.jar"/>
137 <fileset dir="${build.lib.dir}" includes="*.jar"/>
David Reiss56c2c212009-06-04 02:05:25 +0000138 </copy>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000139 <copy todir="${install.javadoc.path}">
Jake Farrell73b8dfc2011-06-02 16:13:18 +0000140 <fileset dir="${javadoc.dir}" includes="**/*"/>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000141 </copy>
Mark Slee83c52a82006-06-07 06:51:18 +0000142 </target>
143
144 <target name="clean">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000145 <delete dir="${build.dir}"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000146 <delete dir="${gen}"/>
147 <delete dir="${genbean}"/>
Mark Slee83c52a82006-06-07 06:51:18 +0000148 </target>
149
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000150 <target name="compile-test" description="Build the test suite classes" depends="generate,dist">
Bryan Duxburybce6fad2011-08-24 00:22:30 +0000151 <javac debug="true" srcdir="${gen}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false">
152 <compilerarg value="-Xlint:deprecation"/>
153 </javac>
154 <javac debug="true" srcdir="${genbean}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false">
155 <compilerarg value="-Xlint:deprecation"/>
156 </javac>
157 <javac debug="true" srcdir="${src.test}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false">
158 <compilerarg value="-Xlint:deprecation"/>
159 </javac>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000160 <copy todir="${build.test.dir}">
161 <fileset dir="${src.test}" includes="log4j.properties"/>
Todd Lipconfcaa8f52010-09-27 23:51:22 +0000162 </copy>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000163 <jar jarfile="${test.jar.file}" basedir="${build.test.dir}"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000164 </target>
165
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000166 <target name="junit-test" description="Run the JUnit test suite" depends="compile-test">
167 <mkdir dir="${test.log.dir}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000168 <junit printsummary="true" showoutput="${test.output}" timeout="${test.timeout}"
Jake Farrell4b8faf92011-04-19 21:11:54 +0000169 haltonfailure="true" errorProperty="tests.failed" failureProperty="tests.failed"
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000170 fork="true" forkmode="perTest" maxmemory="512m"
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000171 >
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000172 <sysproperty key="build.test" value="${build.test.dir}"/>
173 <sysproperty key="test.port" value="${test.port}"/>
Bryan Duxbury1b130832010-10-19 17:20:57 +0000174 <sysproperty key="javax.net.ssl.trustStore" value="${src.test}/.truststore"/>
175 <sysproperty key="javax.net.ssl.trustStorePassword" value="thrift"/>
176 <sysproperty key="javax.net.ssl.keyStore" value="${src.test}/.keystore"/>
177 <sysproperty key="javax.net.ssl.keyStorePassword" value="thrift"/>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000178 <classpath refid="test.classpath"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000179 <formatter type="${test.junit.output.format}"/>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000180 <batchtest todir="${test.log.dir}" unless="testcase">
Roger Meier5013de22010-10-25 19:57:26 +0000181 <fileset dir="${test.src.dir}">
182 <include name="**/Test*.java"/>
183 <exclude name="**/TestClient.java"/>
184 <exclude name="**/TestServer.java"/>
185 <exclude name="**/TestNonblockingServer.java"/>
186 </fileset>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000187 </batchtest>
188 <batchtest todir="${test.log.dir}" if="testcase">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000189 <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000190 </batchtest>
191 </junit>
192 <fail if="tests.failed">Tests failed!</fail>
193 </target>
194
195 <target name="deprecated-test" description="Run the non-JUnit test suite" depends="compile-test">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000196 <java classname="org.apache.thrift.test.EqualityTest" classpathref="test.classpath" failonerror="true"/>
197 <java classname="org.apache.thrift.test.JavaBeansTest" classpathref="test.classpath" failonerror="true"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000198 </target>
199
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000200 <target name="test" description="Run the full test suite" depends="junit-test,deprecated-test"/>
201
Roger Meier62b7cfb2010-10-23 22:25:04 +0000202 <target name="testclient" description="Run a test client" depends="compile-test">
David Reiss2727fab2009-12-09 19:30:01 +0000203 <java classname="org.apache.thrift.test.TestClient"
204 classpathref="test.classpath" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000205 <arg line="${testargs}"/>
David Reiss2727fab2009-12-09 19:30:01 +0000206 </java>
207 </target>
208
Roger Meier62b7cfb2010-10-23 22:25:04 +0000209 <target name="testserver" description="Run a test server" depends="compile-test">
David Reiss2727fab2009-12-09 19:30:01 +0000210 <java classname="org.apache.thrift.test.TestServer"
211 classpathref="test.classpath" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000212 <arg line="${testargs}"/>
David Reiss2727fab2009-12-09 19:30:01 +0000213 </java>
214 </target>
215
Roger Meier62b7cfb2010-10-23 22:25:04 +0000216 <target name="testnonblockingserver" description="Run a test nonblocking server" depends="compile-test">
David Reiss2727fab2009-12-09 19:30:01 +0000217 <java classname="org.apache.thrift.test.TestNonblockingServer"
218 classpathref="test.classpath" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000219 <arg line="${testargs}"/>
David Reiss2727fab2009-12-09 19:30:01 +0000220 </java>
221 </target>
222
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000223 <target name="generate">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000224 <!-- Generate the thrift gen-java source -->
Bryan Duxbury2845b162009-11-09 15:55:22 +0000225 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000226 <arg line="--gen java:hashcode ${test.thrift.home}/ThriftTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000227 </exec>
Bryan Duxbury2845b162009-11-09 15:55:22 +0000228 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000229 <arg line="--gen java:hashcode ${test.thrift.home}/DebugProtoTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000230 </exec>
Bryan Duxbury2845b162009-11-09 15:55:22 +0000231 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000232 <arg line="--gen java:hashcode ${test.thrift.home}/OptionalRequiredTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000233 </exec>
Bryan Duxbury2845b162009-11-09 15:55:22 +0000234 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000235 <arg line="--gen java:beans,nocamel ${test.thrift.home}/JavaBeansTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000236 </exec>
237 </target>
238
Bryan Duxbury35dd47b2011-06-23 22:21:20 +0000239 <target name="proxy" if="proxy.enabled">
240 <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
241 proxyuser="${proxy.user}" proxypassword="${proxy.pass}"/>
242 </target>
243
244 <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check,proxy" unless="mvn.ant.tasks.found">
Jake Farrell4b8faf92011-04-19 21:11:54 +0000245 <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000246 </target>
247
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000248 <target name="mvn.ant.tasks.check">
249 <condition property="mvn.ant.tasks.found">
250 <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
251 </condition>
Jake Farrell4b8faf92011-04-19 21:11:54 +0000252 </target>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000253
254 <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished">
255 <!-- Download mvn ant tasks, download dependencies, and setup pom file -->
Jake Farrell4b8faf92011-04-19 21:11:54 +0000256 <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000257
258 <!-- remote repositories used to download dependencies from -->
259 <artifact:remoteRepository id="central" url="${mvn.repo}"/>
260 <artifact:remoteRepository id="apache" url="${apache.repo}"/>
261
262 <!-- Pom file information -->
263 <artifact:pom id="pom"
264 groupId="${thrift.groupid}"
265 artifactId="${thrift.artifactid}"
266 version="${version}"
267 url="http://thrift.apache.org"
268 name="Apache Thrift"
269 description="Thrift is a software framework for scalable cross-language services development."
270 packaging="pom"
271 >
272 <remoteRepository refid="central"/>
273 <remoteRepository refid="apache"/>
274 <license name="The Apache Software License, Version 2.0" url="${license}"/>
275 <scm connection="scm:svn:http://svn.apache.org/repos/asf/thrift/trunk/"
276 developerConnection="scm:svn:http://svn.apache.org/repos/asf/thrift/trunk/"
277 url="http://svn.apache.org/viewcvs.cgi/thrift"
278 />
279 <!-- Thrift Developers -->
280 <developer id="mcslee" name="Mark Slee"/>
281 <developer id="dreiss" name="David Reiss"/>
282 <developer id="aditya" name="Aditya Agarwal"/>
283 <developer id="marck" name="Marc Kwiatkowski"/>
284 <developer id="jwang" name="James Wang"/>
285 <developer id="cpiro" name="Chris Piro"/>
286 <developer id="bmaurer" name="Ben Maurer"/>
287 <developer id="kclark" name="Kevin Clark"/>
288 <developer id="jake" name="Jake Luciani"/>
289 <developer id="bryanduxbury" name="Bryan Duxbury"/>
290 <developer id="esteve" name="Esteve Fernandez"/>
291 <developer id="todd" name="Todd Lipcon"/>
292 <developer id="geechorama" name="Andrew McGeachie"/>
293 <developer id="molinaro" name="Anthony Molinaro"/>
294 <developer id="roger" name="Roger Meier"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +0000295 <developer id="jfarrell" name="Jake Farrell"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000296
297 <!-- Thrift dependencies list -->
298 <dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.5.8"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000299 <dependency groupId="commons-lang" artifactId="commons-lang" version="2.5"/>
Jake Farrell13b21182011-08-28 18:24:45 +0000300 <dependency groupId="javax.servlet" artifactId="servlet-api" version="2.5" scope="provided"/>
Bryan Duxburybce6fad2011-08-24 00:22:30 +0000301 <dependency groupId="org.apache.httpcomponents" artifactId="httpclient" version="4.1.2"/>
302 <dependency groupId="org.apache.httpcomponents" artifactId="httpcore" version="4.1.3"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000303 </artifact:pom>
304
305 <!-- Generate the pom file -->
306 <artifact:writepom pomRefId="pom" file="${pom.xml}"/>
307
308 <!-- Download the dependencies -->
309 <artifact:dependencies filesetId="build-dependency-jars" pomRefId="pom"/>
310
311 <!-- Copy the dependencies to the build/lib dir -->
312 <copy todir="${build.dir}/lib">
313 <fileset refid="build-dependency-jars"/>
314 <mapper type="flatten"/>
315 </copy>
316
Jake Farrell6ece9be2011-04-26 15:44:50 +0000317 <!-- Dependencies needed for testing -->
318 <artifact:dependencies filesetId="test-dependency-jars" useScope="runtime">
319 <dependency groupId="org.slf4j" artifactId="slf4j-log4j12" version="1.5.8"/>
320 <dependency groupId="junit" artifactId="junit" version="4.4"/>
321 </artifact:dependencies>
322
323 <!-- Copy the test dependencies to the build/lib dir -->
324 <copy todir="${build.dir}/lib">
325 <fileset refid="test-dependency-jars"/>
326 <mapper type="flatten"/>
327 </copy>
328
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000329 <property name="mvn.finished" value="true"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000330 </target>
331
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000332 <macrodef name="signAndDeploy">
333 <!-- Sign and deploy jars to apache repo -->
334 <attribute name="file"/>
335 <attribute name="classifier" default=""/>
336 <attribute name="packaging" default="jar"/>
Jake Farrellc023d902011-05-20 19:04:13 +0000337 <attribute name="pom" default=""/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000338 <sequential>
339 <artifact:mvn fork="true">
340 <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/>
341 <arg value="-DrepositoryId=${maven-repository-id}"/>
342 <arg value="-Durl=${maven-repository-url}"/>
Jake Farrellc023d902011-05-20 19:04:13 +0000343 <arg value="-DpomFile=@{pom}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000344 <arg value="-Dfile=@{file}"/>
345 <arg value="-Dclassifier=@{classifier}"/>
346 <arg value="-Dpackaging=@{packaging}"/>
347 <arg value="-Pgpg"/>
348 </artifact:mvn>
349 </sequential>
350 </macrodef>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000351
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000352 <target name="publish" depends="clean,init,test,dist,javadoc,pack.src">
353 <!-- Compile, package, test and then send release to apache maven repo -->
354 <!-- run with: ant -Drelease=true publish-->
Jake Farrellc023d902011-05-20 19:04:13 +0000355 <signAndDeploy file="${pom.xml}" packaging="pom" classifier="" pom="${pom.xml}"/>
356 <signAndDeploy file="${jar.file}" packaging="jar" classifier="" pom="${pom.xml}"/>
357 <signAndDeploy file="${javadoc.jar.file}" packaging="jar" classifier="javadoc" pom="${pom.xml}"/>
358 <signAndDeploy file="${source.tar.gz}" packaging="src" classifier="tar.gz" pom="${pom.xml}"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000359 </target>
Mark Slee83c52a82006-06-07 06:51:18 +0000360</project>