protoj.lang
Class PublishFeature

java.lang.Object
  extended by protoj.lang.PublishFeature

public final class PublishFeature
extends java.lang.Object

Publishes project artifacts to a maven repository by performing a maven deploy. The details of the repository must be configured through the API

Author:
Ashley Williams

Constructor Summary
PublishFeature(StandardProject parent, java.lang.String url)
          An example of a url is "scp://shell.sourceforge.net:/home/users/a/ag/agwilliams10000".
 
Method Summary
 void deploy(java.lang.String artifactName, java.lang.String userName, java.lang.String key, java.lang.String password, java.lang.String passphrase)
          Deploys the archive with the given name to the maven repository.
 void deployAll(java.lang.String userName, java.lang.String key, java.lang.String password, java.lang.String passphrase)
          Deploys all registered classes archives that are configured with maven pom files to the maven repository.
 ClassesArchive.ClassesEntry getCurrentClassesEntry()
          Represents the artifact that contains the project class files that is currently being deployed.
 org.apache.maven.artifact.ant.DeployTask getCurrentDeployTask()
          The task being processed by deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String), responsible for copying the artifacts to the repository.
 org.apache.maven.artifact.ant.Pom getCurrentPom()
          The task being processed by deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String), responsible for loading in the pom file.
 StandardProject getParent()
          The parent of this feature.
 java.lang.String getUrl()
          The url where artifacts are published to.
 java.io.File getWorkingDir()
          The directory where the ivy and maven files are extracted to.
 void initConfig(ArgRunnable<PublishFeature> config)
          The provided config argument is called back when deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) is invoked so that further configuration of this feature may be applied.
 void initProvider(java.lang.String artifactId, java.lang.String version)
          If a url is going to be used that uses a transport protocol, use this method to ensure the appropriate wagon provider is configured.
 boolean isUsingProvider()
          Whether or not a maven wagon provider has been configured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublishFeature

public PublishFeature(StandardProject parent,
                      java.lang.String url)
An example of a url is "scp://shell.sourceforge.net:/home/users/a/ag/agwilliams10000". Since this example url uses the scp protocol, initProvider(String, String) must be called as follows:
 pub.initProvider("wagon-ssh", "1.0-beta-2");
 
See the maven documentation for more information.

Parameters:
parent - the owner of this feature
url - the location that the artifact should be published to
Method Detail

initConfig

public void initConfig(ArgRunnable<PublishFeature> config)
The provided config argument is called back when deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) is invoked so that further configuration of this feature may be applied.

Parameters:
config -

initProvider

public void initProvider(java.lang.String artifactId,
                         java.lang.String version)
If a url is going to be used that uses a transport protocol, use this method to ensure the appropriate wagon provider is configured.

Parameters:
artifactId -
version -

deployAll

public void deployAll(java.lang.String userName,
                      java.lang.String key,
                      java.lang.String password,
                      java.lang.String passphrase)
Deploys all registered classes archives that are configured with maven pom files to the maven repository. Passes each archive to deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) .

Parameters:
userName -
key -
passphrase -
password -

deploy

public void deploy(java.lang.String artifactName,
                   java.lang.String userName,
                   java.lang.String key,
                   java.lang.String password,
                   java.lang.String passphrase)
Deploys the archive with the given name to the maven repository. The authentication credentials are passed straight through to the underlying maven ant tasks, so consult the maven website for more information.

Parameters:
artifactName - the name of the artifact to publish
userName - mandatory where a wagon provider has been provided
key - can be null if the default ssh client key location is to be used or if key based authentication isn't configured
password - the password to use, usually not null unless a passphrase is being specified
passphrase - the key based authentication passphrase, can be null if a password is being used or if there is no passphrase for the private key

getParent

public StandardProject getParent()
The parent of this feature.

Returns:

getCurrentDeployTask

public org.apache.maven.artifact.ant.DeployTask getCurrentDeployTask()
The task being processed by deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String), responsible for copying the artifacts to the repository.

Returns:

getCurrentClassesEntry

public ClassesArchive.ClassesEntry getCurrentClassesEntry()
Represents the artifact that contains the project class files that is currently being deployed.

Returns:

getCurrentPom

public org.apache.maven.artifact.ant.Pom getCurrentPom()
The task being processed by deploy(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String), responsible for loading in the pom file.

Returns:

getUrl

public java.lang.String getUrl()
The url where artifacts are published to.

Returns:

isUsingProvider

public boolean isUsingProvider()
Whether or not a maven wagon provider has been configured.

Returns:

getWorkingDir

public java.io.File getWorkingDir()
The directory where the ivy and maven files are extracted to.

Returns: