| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ****************************************************************************** |
| * Copyright (c) 2008, 2010 VMware Inc. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * VMware Inc. - initial contribution |
| ****************************************************************************** |
| --> |
| <project name="publish-common" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:maven="antlib:org.apache.maven.artifact.ant"> |
| |
| <import file="common.xml"/> |
| |
| <!-- Main targets --> |
| <target name="publish-ivy" depends="ivy.init, resolve" description="Publishes all artifacts to remote Eclipse Ivy repositories"> |
| <delete quiet="true" file="${ivy.output.file}"/> |
| <mkdir dir="${ivy.output.dir}"/> |
| <ivy:publish resolver="eclipse-remote-bundle-publish" overwrite="true" pubdate="${timestamp}" status="${release.type}"> |
| <artifacts pattern="${ivy.output.dir}/[artifact].[ext]"/> |
| <artifacts pattern="${jar.output.dir}/[artifact].[ext]"/> |
| <artifacts pattern="${source-jar.output.dir}/[artifact].[ext]"/> |
| </ivy:publish> |
| </target> |
| |
| <target name="publish-mirrored-ivy" depends="ivy.init, resolve" description="Publishes all mirrored Orbit artifacts to remote Eclipse Ivy repositories"> |
| <mkdir dir="${ivy.output.dir}"/> |
| <ivy:publish resolver="eclipse-remote-bundle-publish" overwrite="true" organisation="${organisation}" module="${module}" pubrevision="${revision}" status="release"> |
| <artifacts pattern="${ivy.output.dir}/[artifact].[ext]"/> |
| <artifacts pattern="${jar.output.dir}/[artifact].[ext]"/> |
| <artifacts pattern="${source-jar.output.dir}/[artifact].[ext]"/> |
| </ivy:publish> |
| </target> |
| |
| <target name="publish-maven" depends="create.pom, snapshot.pom, maven.init" description="Publishes all artifacts to remote Eclipse Maven repositories"> |
| <maven:deploy file="${jar.output.file}"> |
| <remoteRepository url="scp://build.eclipse.org/opt/public/rt/virgo/maven/bundles/${adjusted.release.type}"> |
| <authentication username="${eclipse.buildId}" privateKey="${key.file}"/> |
| </remoteRepository> |
| <pom file="${pom.output.file}"/> |
| <attach file="${source-jar.output.file}" classifier="sources"/> |
| </maven:deploy> |
| </target> |
| |
| <target name="publish-maven-central-stage" depends="create.pom, snapshot.pom, maven.init" unless="local.build" description="Publishes all artifacts to remote Eclipse Maven repositories"> |
| <!-- sign and deploy the main artifact --> |
| <maven:mvn> |
| <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> |
| <arg value="-Durl=${maven-staging-repository-url}" /> |
| <arg value="-DrepositoryId=${maven-staging-repository-id}" /> |
| <arg value="-DpomFile=${pom.output.file}" /> |
| <arg value="-Dfile=${jar.output.file}" /> |
| <arg value="-Pgpg" /> |
| </maven:mvn> |
| |
| <!-- sign and deploy the sources artifact --> |
| <maven:mvn> |
| <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> |
| <arg value="-Durl=${maven-staging-repository-url}" /> |
| <arg value="-DrepositoryId=${maven-staging-repository-id}" /> |
| <arg value="-DpomFile=${pom.output.file}" /> |
| <arg value="-Dfile=${source-jar.output.file}" /> |
| <arg value="-Dclassifier=sources" /> |
| <arg value="-Pgpg" /> |
| </maven:mvn> |
| |
| <!-- sign and deploy the javadoc artifact --> |
| <maven:mvn> |
| <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> |
| <arg value="-Durl=${maven-staging-repository-url}" /> |
| <arg value="-DrepositoryId=${maven-staging-repository-id}" /> |
| <arg value="-DpomFile=${pom.output.file}" /> |
| <arg value="-Dfile=${virgo.build.dir}/common/fake-javadoc.jar" /> |
| <!-- |
| <arg value="-Dfile=${maven-javadoc-jar}" /> |
| --> |
| <arg value="-Dclassifier=javadoc" /> |
| <arg value="-Pgpg" /> |
| </maven:mvn> |
| </target> |
| |
| <target name="install-maven" depends="create.pom, snapshot.pom, maven.init"> |
| <maven:install file="${jar.output.file}"> |
| <pom file="${pom.output.file}"/> |
| <attach file="${source-jar.output.file}" classifier="sources"/> |
| </maven:install> |
| </target> |
| |
| <!-- Other targets --> |
| <target name="maven.init" depends="ivy.init"> |
| <ivy:cachepath resolveId="maven.ant.tasks.classpath" pathid="maven.ant.tasks.classpath" |
| organisation="org.apache.maven" module="com.springsource.org.apache.maven.ant" |
| revision="${org.apache.maven.ant.version}" conf="runtime" type="jar" inline="true" log="download-only"/> |
| <taskdef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" |
| classpathref="maven.ant.tasks.classpath"/> |
| <maven:install-provider groupId="org.springframework.build.aws" artifactId="org.springframework.build.aws.maven" version="${org.springframework.build.aws.maven.version}"/> |
| <maven:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/> |
| </target> |
| |
| <target name="create.pom" depends="ivy.init, resolve"> |
| <delete quiet="true" file="${pom.output.file}"/> |
| <mkdir dir="${pom.output.dir}"/> |
| |
| <ivy:makepom ivyfile="${ivy.output.file}" pomfile="${pom.output.file}" templatefile="${virgo.build.dir}/common/pom.template"> |
| <mapping conf="compile" scope="compile"/> |
| <mapping conf="provided" scope="provided"/> |
| <mapping conf="server-provided" scope="provided"/> |
| <mapping conf="runtime" scope="runtime"/> |
| <mapping conf="test" scope="test"/> |
| </ivy:makepom> |
| <replaceregexp flags="g" match="latest.integration" replace="${project.version}" file="${pom.output.file}"/> |
| </target> |
| |
| <target name="snapshot.pom" depends="is.snapshot" if="snapshot.release"> |
| <replaceregexp flags="g" match="(\d(.\d(.\d)?)?).${build.stamp}" replace="\1.BUILD-SNAPSHOT" file="${pom.output.file}"/> |
| </target> |
| |
| <target name="is.snapshot"> |
| <condition property="snapshot.release"> |
| <equals arg1="integration" arg2="${release.type}"/> |
| </condition> |
| </target> |
| |
| </project> |