Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

94 lines (81 sloc) 4.324 kb
<?xml version="1.0"?>
<project name="Functional Java Maven Build" default="maven-deploy" basedir=".">
<import file="buildj.xml" optional="true"/>
<property name="maven-build.dir" value="${build.dir}/maven"/>
<!-- Note. Artifact ID must match that in pom.xml -->
<property name="artifact-id" value="fj"/>
<property name="project.jar" value="${archive.file}"/>
<property name="sources.jar" value="${artifact-id}-${build.number}-sources.jar"/>
<property name="javadoc.jar" value="${artifact-id}-${build.number}-javadoc.jar"/>
<property name="maven-bundle.jar" value="${artifact-id}-${build.number}-bundle.jar"/>
<target name="-maven-bundle" depends="archive,javadoc" description="Creates Maven bundle files">
<fail unless="build.number" message="set the build.number property"/>
<mkdir dir="${maven-build.dir}"/>
<copy file="${build.dir}/archive/${archive.file}" tofile="${maven-build.dir}/${project.jar}"/>
<copy file="pom.xml" todir="${maven-build.dir}"/>
<zip destfile="${maven-build.dir}/${javadoc.jar}">
<zipfileset dir="${build.dir}/javadoc"/>
</zip>
<zip destfile="${maven-build.dir}/${sources.jar}">
<zipfileset dir="${build.dir}/src"/>
<zipfileset dir="${build.dir}/test-src"/>
</zip>
<zip destfile="${maven-build.dir}/${maven-bundle.jar}">
<zipfileset dir="${maven-build.dir}">
<include name="${project.jar}"/>
<include name="${sources.jar}"/>
<include name="${javadoc.jar}"/>
<include name="pom.xml"/>
</zipfileset>
</zip>
</target>
<target name="maven-deploy" depends="archive,-maven-bundle" description="Deploys Maven artefacts to local repo">
<fail unless="build.number" message="set the build.number property"/>
<tempfile property="maven-repo.dir" destdir="${maven-build.dir}"/>
<property name="maven-repo-release.dir" value="${maven-repo.dir}/org/functionaljava/fj/${build.number}"/>
<mkdir dir="${maven-repo.dir}"/>
<java classname="org.tmatesoft.svn.cli.SVN" fork="true">
<classpath refid="libs.path"/>
<arg value="checkout"/>
<arg value="${repository}/maven"/>
<arg value="${maven-repo.dir}"/>
<arg value="--username"/>
<arg value="${build.username}"/>
<arg value="--password"/>
<arg value="${build.password}"/>
</java>
<exec dir="${basedir}" executable="mvn" failonerror="true" os="Mac OS X,Linux">
<arg value="deploy:deploy-file"/>
<arg value="-Durl=file://${maven-repo.dir}"/>
<arg value="-DrepositoryId=local-svn-artifacts"/>
<arg value="-Dfile=${maven-build.dir}/${project.jar}"/>
<arg value="-DpomFile=${basedir}/pom.xml"/>
</exec>
<copy file="${maven-build.dir}/${maven-bundle.jar}" todir="${maven-repo-release.dir}"/>
<copy file="${maven-build.dir}/${sources.jar}" todir="${maven-repo-release.dir}"/>
<copy file="${maven-build.dir}/${javadoc.jar}" todir="${maven-repo-release.dir}"/>
<checksum file="${maven-repo-release.dir}/${maven-bundle.jar}" algorithm="MD5" forceOverwrite="yes" fileext=".md5"/>
<checksum file="${maven-repo-release.dir}/${maven-bundle.jar}" algorithm="SHA" forceOverwrite="yes" fileext=".sha1"/>
<checksum file="${maven-repo-release.dir}/${sources.jar}" algorithm="MD5" forceOverwrite="yes" fileext=".md5"/>
<checksum file="${maven-repo-release.dir}/${sources.jar}" algorithm="SHA" forceOverwrite="yes" fileext=".sha1"/>
<checksum file="${maven-repo-release.dir}/${javadoc.jar}" algorithm="MD5" forceOverwrite="yes" fileext=".md5"/>
<checksum file="${maven-repo-release.dir}/${javadoc.jar}" algorithm="SHA" forceOverwrite="yes" fileext=".sha1"/>
<java classname="org.tmatesoft.svn.cli.SVN" fork="true">
<classpath refid="libs.path"/>
<arg value="add"/>
<arg value="${maven-repo-release.dir}"/>
<arg value="--force"/>
</java>
<java classname="org.tmatesoft.svn.cli.SVN" fork="true">
<classpath refid="libs.path"/>
<arg value="commit"/>
<arg value="${maven-repo.dir}"/>
<arg value="--message"/>
<arg value="Maven artefacts for release ${build.number}"/>
<arg value="--username"/>
<arg value="${build.username}"/>
<arg value="--password"/>
<arg value="${build.password}"/>
</java>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.