| <project name="nexus-deploy" default="stage" basedir="." |
| xmlns:artifact="antlib:org.apache.maven.artifact.ant" |
| xmlns:maven="antlib:org.apache.maven.artifact.ant"> |
| <!-- |
| 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. |
| --> |
| <property file="${basedir}/build.properties" /> |
| <import file="${basedir}/build.xml" as="apache"/> |
| |
| <macrodef name="nexus-plugin" description="macro definition for publishing artifacts to nexus"> |
| <attribute name="maven-jar"/> |
| <attribute name="attachas" default=""/> |
| <sequential> |
| <artifact:mvn mavenHome="${env.MAVEN_HOME}" fork="true"> |
| <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/> |
| <arg value="-Durl=${staging_repo_url}"/> |
| <arg value="-DrepositoryId=${staging_repo_id}"/> |
| <arg value="-Dfile=@{maven-jar}"/> |
| <arg value="-Dpackaging=jar"/> |
| <arg value="-DpomFile=${dist.maven.dir}/${name}.pom"/> |
| <arg value="-Dclassifier=@{attachas}"/> |
| <arg value="-Dtype=jar"/> |
| <arg value="-Pgpg"/> |
| </artifact:mvn> |
| </sequential> |
| </macrodef> |
| |
| <target name="stage" depends="apache.mvn-taskdef, apache.bin-package" description="deploy artifact to a nexus repository"> |
| <nexus-plugin maven-jar="${dist.maven.dir}/${final.name}.jar"/> |
| <nexus-plugin maven-jar="${dist.maven.dir}/${final.name}-tests.jar" attachas="tests"/> |
| <nexus-plugin maven-jar="${dist.maven.dir}/${final.name}-sources.jar" attachas="sources"/> |
| <nexus-plugin maven-jar="${dist.maven.dir}/${final.name}-tests.jar" attachas="javadoc"/> |
| </target> |
| </project> |