| ------ |
| Install and Deploy |
| ------ |
| Brett Porter |
| Hervé Boutemy |
| Paul Gier |
| ------ |
| 2009-05-06 |
| ------ |
| |
| ~~ 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. |
| |
| ~~ NOTE: For help with the syntax of this file, see: |
| ~~ http://maven.apache.org/doxia/references/apt-format.html |
| |
| Install and Deploy |
| |
| If you want to share your built artifacts between projects, you can use two other tasks: <<<install>>> for |
| installing them in your local repository for access as dependencies in other scripts, and <<<deploy>>> for |
| deploying them to a remote location you have set up to serve as a repository in your organisation. |
| |
| <<Note:>> that the installation and deployment require that you have a Maven 2.0 POM file to deploy along with it. |
| These are required for the transitive dependency mechanism to work effectively, and can be quite simple to |
| create. |
| |
| The following example shows basic use of the <<<install>>> and <<<deploy>>> tasks. |
| |
| ----- |
| ... |
| <artifact:pom id="mypom" file="pom.xml" /> |
| |
| <artifact:install file="target/my-project-1.0.jar"> |
| <pom refid="mypom"/> |
| </artifact:install> |
| |
| <artifact:deploy file="target/my-project-1.0.jar"> |
| <remoteRepository url="file:///www/repository"/> |
| <pom refid="mypom"/> |
| </artifact:deploy> |
| ... |
| ----- |
| |
| Attaching Multiple Artifacts |
| |
| The install and deploy tasks allow you to attach multiple artifact to a single deployment. For example, |
| the sources and javadoc jars can be attached using the nested <<attach>> element. |
| |
| ----- |
| <artifact:deploy file="target/my-project-1.0.jar"> |
| <remoteRepository url="http://localhost/www/repository"/> |
| <pom refid="mypom"/> |
| <attach file="${basedir}/target/my-project-1.0-sources.jar" type="jar" classifier="sources"/> |
| <attach file="${basedir}/target/my-project-1.0-javadoc.jar" type="jar" classifier="javadoc"/> |
| <attach file="${basedir}/target/my-project-1.0-junk.zip" type="zip" classifier="junk"/> |
| </artifact:deploy> |
| ----- |
| |
| Deployment Protocols |
| |
| For deploying using a protocol other than local file system, you need to register a provider to make the other |
| protocols available. For example: |
| |
| ----- |
| ... |
| <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/> |
| |
| <artifact:deploy file="target/my-project-1.0.jar"> |
| <remoteRepository url="scp://localhost/www/repository"> |
| <authentication username="${repository.username}" privateKey="${user.home}/.ssh/id_dsa"/> |
| </remoteRepository> |
| <pom refid="mypom"/> |
| </artifact:deploy> |
| ... |
| ----- |
| |
| <<Note:>> that if you use <<<antcall>>>, the provider isn't available during the Ant call: you have to register |
| it again if you need it. |
| |
| ~~ TODO: Explain more thoroughly when you need to register a provider |
| |
| Maven Ant Tasks contain <<<wagon-file>>> and <<<wagon-http-lightweight>>> providers. The other available providers are: |
| |
| *--------------+--------------------------+-------------------+ |
| | Protocol | Artifact ID | Version | |
| *--------------+--------------------------+-------------------+ |
| | <<<http>>> | <<<wagon-http>>> | <<<1.0-beta-2>>> | |
| *--------------+--------------------------+-------------------+ |
| | <<<scp>>> | <<<wagon-ssh>>> | <<<1.0-beta-2>>> | |
| *--------------+--------------------------+-------------------+ |
| | <<<scpexe>>> | <<<wagon-ssh-external>>> | <<<1.0-beta-2>>> | |
| *--------------+--------------------------+-------------------+ |
| | <<<ftp>>> | <<<wagon-ftp>>> | <<<1.0-beta-2>>> | |
| *--------------+--------------------------+-------------------+ |
| | <<<webdav>>> | <<<wagon-webdav>>> | <<<1.0-beta-2>>> | |
| *--------------+--------------------------+-------------------+ |