org.apache.maven.artifact.deployer
Class DefaultArtifactDeployer

java.lang.Object
  extended byorg.apache.maven.artifact.deployer.DefaultArtifactDeployer
All Implemented Interfaces:
ArtifactDeployer
Direct Known Subclasses:
NamedArtifactDeployer

public class DefaultArtifactDeployer
extends Object
implements ArtifactDeployer

Default implementation of Artifact Deployer interface.

Version:
$Id: DefaultArtifactDeployer.java 538499 2007-05-16 09:30:20Z ltheussl $
Author:
Michal Maczka

Field Summary
protected static String POM_TYPE
           
static String SIGNATURE_EXTENSION
           
protected static String SNAPSHOT_FORMAT
          Date/time stamp which is appended to snapshot filenames
protected  String snapshotSignature
           
 
Constructor Summary
DefaultArtifactDeployer()
           
 
Method Summary
protected  File createSnapshotVersionFile(File artifact, String snapshotVersion, String artifactId, String type)
          Create a file which contains timestamp of the latetst snapshot
 void deploy(String artifact, String type, org.apache.maven.project.Project project, org.apache.maven.repository.ArtifactTypeHandler handler)
          Deploy given artifact to remote repository.
protected  void deployFile(org.apache.maven.wagon.repository.Repository repository, File src, String dest, org.apache.maven.project.Project project, boolean gpgSkip, String gpgPass, boolean gpgUseAgent, String gpgKeyname)
           
protected  void deployFiles(org.apache.maven.wagon.repository.Repository repository, List srcFiles, List destFiles, org.apache.maven.wagon.authentication.AuthenticationInfo authenticationInfo, org.apache.maven.project.Project project, boolean gpgSkip, String gpgPass, boolean gpgUseAgent, String gpgKeyname)
           
 void deploySnapshot(String artifact, String type, org.apache.maven.project.Project project, org.apache.maven.repository.ArtifactTypeHandler handler)
          Deploy given artifact as a snapshot to remote repository.
protected  String findSshIdentity()
           
protected  File generateSignatureForArtifact(File file, String pass, boolean useAgent, String keyname)
           
protected  File getFileForArtifact(String artifact)
           
protected  String getPassphrase(org.apache.maven.project.Project project)
           
protected  String getSnapshotSignature()
           
protected  void handleDeploy(String type, org.apache.maven.project.Project project, String artifactId, String artifact, org.apache.maven.repository.ArtifactTypeHandler handler, String version)
           
 void install(String artifact, String type, org.apache.maven.project.Project project, org.apache.maven.repository.ArtifactTypeHandler handler)
          Install given artifact in local repository.
 void installSnapshot(String artifact, String type, org.apache.maven.project.Project project, org.apache.maven.repository.ArtifactTypeHandler handler)
          Install given artifact as snapshot in local repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POM_TYPE

protected static final String POM_TYPE
See Also:
Constant Field Values

SIGNATURE_EXTENSION

public static final String SIGNATURE_EXTENSION
See Also:
Constant Field Values

SNAPSHOT_FORMAT

protected static final String SNAPSHOT_FORMAT
Date/time stamp which is appended to snapshot filenames

See Also:
Constant Field Values

snapshotSignature

protected String snapshotSignature
Constructor Detail

DefaultArtifactDeployer

public DefaultArtifactDeployer()
Method Detail

deploy

public void deploy(String artifact,
                   String type,
                   org.apache.maven.project.Project project,
                   org.apache.maven.repository.ArtifactTypeHandler handler)
            throws org.apache.maven.MavenException
Description copied from interface: ArtifactDeployer
Deploy given artifact to remote repository.

Specified by:
deploy in interface ArtifactDeployer
Parameters:
artifact - Artifact filename
type - The type of the artifact (like war, jar)
project - The project which is a producer of the artifact
handler - the type handler for the artifact
Throws:
org.apache.maven.MavenException
See Also:
ArtifactDeployer.deploy(String, String, Project, ArtifactTypeHandler)

deploySnapshot

public void deploySnapshot(String artifact,
                           String type,
                           org.apache.maven.project.Project project,
                           org.apache.maven.repository.ArtifactTypeHandler handler)
                    throws org.apache.maven.MavenException
Description copied from interface: ArtifactDeployer
Deploy given artifact as a snapshot to remote repository.

Specified by:
deploySnapshot in interface ArtifactDeployer
Parameters:
artifact -
type - The type of the artifact (like war, jar)
project - The project which is a producer of the artifact
handler - the type handler for the artifact
Throws:
org.apache.maven.MavenException
See Also:
deploySnapshot(String, String, Project, ArtifactTypeHandler)

handleDeploy

protected void handleDeploy(String type,
                            org.apache.maven.project.Project project,
                            String artifactId,
                            String artifact,
                            org.apache.maven.repository.ArtifactTypeHandler handler,
                            String version)
                     throws org.apache.maven.MavenException
Throws:
org.apache.maven.MavenException

install

public void install(String artifact,
                    String type,
                    org.apache.maven.project.Project project,
                    org.apache.maven.repository.ArtifactTypeHandler handler)
             throws org.apache.maven.MavenException
Description copied from interface: ArtifactDeployer
Install given artifact in local repository.

Specified by:
install in interface ArtifactDeployer
Parameters:
artifact - file name of the artifact
type - The type of the artifact (like war, jar)
project - The project which is a producer of the artifact
handler - the type handler for the artifact
Throws:
org.apache.maven.MavenException
See Also:
ArtifactDeployer.install(String, String, Project, ArtifactTypeHandler)

installSnapshot

public void installSnapshot(String artifact,
                            String type,
                            org.apache.maven.project.Project project,
                            org.apache.maven.repository.ArtifactTypeHandler handler)
                     throws org.apache.maven.MavenException
Description copied from interface: ArtifactDeployer
Install given artifact as snapshot in local repository.

Specified by:
installSnapshot in interface ArtifactDeployer
Parameters:
artifact -
type - The type of the artifact (like war, jar)
project - The project which is a producer of the artifact
handler - the type handler for the artifact
Throws:
org.apache.maven.MavenException
See Also:
ArtifactDeployer.installSnapshot(String, String, Project, ArtifactTypeHandler)

findSshIdentity

protected String findSshIdentity()

deployFile

protected void deployFile(org.apache.maven.wagon.repository.Repository repository,
                          File src,
                          String dest,
                          org.apache.maven.project.Project project,
                          boolean gpgSkip,
                          String gpgPass,
                          boolean gpgUseAgent,
                          String gpgKeyname)
                   throws org.apache.maven.wagon.ResourceDoesNotExistException,
                          MalformedURLException,
                          NoSuchAlgorithmException,
                          org.apache.maven.wagon.TransferFailedException,
                          org.apache.maven.wagon.ConnectionException,
                          org.apache.maven.wagon.authentication.AuthenticationException,
                          org.apache.maven.wagon.authorization.AuthorizationException,
                          org.apache.maven.MavenException
Throws:
org.apache.maven.wagon.ResourceDoesNotExistException
MalformedURLException
NoSuchAlgorithmException
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ConnectionException
org.apache.maven.wagon.authentication.AuthenticationException
org.apache.maven.wagon.authorization.AuthorizationException
org.apache.maven.MavenException

deployFiles

protected void deployFiles(org.apache.maven.wagon.repository.Repository repository,
                           List srcFiles,
                           List destFiles,
                           org.apache.maven.wagon.authentication.AuthenticationInfo authenticationInfo,
                           org.apache.maven.project.Project project,
                           boolean gpgSkip,
                           String gpgPass,
                           boolean gpgUseAgent,
                           String gpgKeyname)
                    throws org.apache.maven.wagon.ConnectionException,
                           org.apache.maven.wagon.authentication.AuthenticationException,
                           org.apache.maven.wagon.ResourceDoesNotExistException,
                           org.apache.maven.wagon.TransferFailedException,
                           org.apache.maven.wagon.authorization.AuthorizationException,
                           MalformedURLException,
                           NoSuchAlgorithmException,
                           org.apache.maven.MavenException
Throws:
org.apache.maven.wagon.ConnectionException
org.apache.maven.wagon.authentication.AuthenticationException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.authorization.AuthorizationException
MalformedURLException
NoSuchAlgorithmException
org.apache.maven.MavenException

getSnapshotSignature

protected String getSnapshotSignature()

getFileForArtifact

protected File getFileForArtifact(String artifact)
                           throws org.apache.maven.MavenException
Throws:
org.apache.maven.MavenException

createSnapshotVersionFile

protected File createSnapshotVersionFile(File artifact,
                                         String snapshotVersion,
                                         String artifactId,
                                         String type)
                                  throws org.apache.maven.MavenException
Create a file which contains timestamp of the latetst snapshot

Throws:
org.apache.maven.MavenException

generateSignatureForArtifact

protected File generateSignatureForArtifact(File file,
                                            String pass,
                                            boolean useAgent,
                                            String keyname)
                                     throws org.apache.maven.MavenException
Parameters:
pass - The passphrase to use when signing. "${maven.artifact.gpg.passphrase}"
keyname - The "name" of the key to sign with. Passed to gpg as --local-user. "${maven.artifact.gpg.keyname}"
useAgent - Passes --use-agent or --no-use-agent to gpg. If using an agent, the password is optional as the agent will provide it. "${maven.artifact.gpg.useagent}"
Throws:
org.apache.maven.MavenException

getPassphrase

protected String getPassphrase(org.apache.maven.project.Project project)
                        throws IOException
Throws:
IOException


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.