org.nuiton.helper.plugin
Class ShareServerSecretPlugin

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.helper.plugin.ShareServerSecretPlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, Plugin

public class ShareServerSecretPlugin
extends AbstractPlugin

Obtain a server authentication and share it in the maven project properties.

To select data to export from the server with the given serverId, fill the properties :

   usernameOut
   passwordOut
   privateKeyOut
   passphraseOut
 

Since:
1.1.0
Author:
chemit
Is defined by the goal name:
share-server-secret
Is bound to the specified phase of the standard build lifecycle:
initialize
Requires a Maven project to run:
true

Nested Class Summary
static class ShareServerSecretPlugin.Property
           
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
Plugin.InitState, Plugin.Packaging
 
Field Summary
protected  java.lang.String passphraseOut
          The name of the property where to export the passphrase of the server.
protected  java.lang.String passwordOut
          The name of the property where to export the password of the server.
protected  java.lang.String privateKeyOut
          The name of the property where to export the private key of the server.
protected  org.apache.maven.project.MavenProject project
          Dependance du projet.
protected  boolean runOnce
          Un flag pour ne lancer le plugin qu'une seule fois par build.
protected  org.sonatype.plexus.components.sec.dispatcher.SecDispatcher sec
          password decypher
protected  java.lang.String serverId
          Server id to use for authentication (must be defined in your setting and use the maven >= 2.1.0 password encryption mecanism).
protected  org.apache.maven.settings.Settings settings
          Dependance du settings.
protected  java.lang.String usernameOut
          The name of the property where to export the username of the server.
protected  boolean verbose
          Un flag pour activer le mode verbeux.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ShareServerSecretPlugin()
           
 
Method Summary
protected  boolean checkSkip()
          Checks if the mojo execution should be skipped.
protected  void doAction()
          Do plugin action.
 java.lang.String getPassphraseOut()
           
 java.lang.String getPasswordOut()
           
 java.lang.String getPrivateKeyOut()
           
 org.apache.maven.project.MavenProject getProject()
           
 java.lang.String getServerId()
           
 java.lang.String getUsernameOut()
           
protected  void init()
          Method to initialize the mojo before doing any concrete actions.
 boolean isVerbose()
           
 void setPassphraseOut(java.lang.String passphraseOut)
           
 void setPasswordOut(java.lang.String passwordOut)
           
 void setPrivateKeyOut(java.lang.String privateKeyOut)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setServerId(java.lang.String serverId)
           
 void setUsernameOut(java.lang.String usernameOut)
           
 void setVerbose(boolean verbose)
           
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
getLog, setLog
 

Field Detail

project

protected org.apache.maven.project.MavenProject project
Dependance du projet.

Since:
1.1.0
Is defined by:
default-value:
${project}
Is readonly.
Is required.

settings

protected org.apache.maven.settings.Settings settings
Dependance du settings.

Since:
1.1.0
Is defined by:
default-value:
${settings}
Is readonly.
Is required.

serverId

protected java.lang.String serverId
Server id to use for authentication (must be defined in your setting and use the maven >= 2.1.0 password encryption mecanism).

Since:
1.1.0
Is defined by:
expression:
${helper.serverId}
Is required.

usernameOut

protected java.lang.String usernameOut
The name of the property where to export the username of the server.

Note: If not set - then no export of the username of the server.

Since:
1.1.0
Is defined by:

passwordOut

protected java.lang.String passwordOut
The name of the property where to export the password of the server.

Note: If not set - then no export of the password of the server.

Note: If the password is crypted (since maven 2.1.0) then decrypt it.

Since:
1.1.0
Is defined by:

passphraseOut

protected java.lang.String passphraseOut
The name of the property where to export the passphrase of the server.

Note: If not set - then no export of the passphrase of the server.

Note: If the passphrase is crypted (since maven 2.1.0) then decrypt it.

Since:
1.1.0
Is defined by:

privateKeyOut

protected java.lang.String privateKeyOut
The name of the property where to export the private key of the server.

Note: If not set - then no export of the private key of the server.

Since:
1.1.0
Is defined by:

verbose

protected boolean verbose
Un flag pour activer le mode verbeux.

Since:
1.1.0
Is defined by:
expression:
${helper.verbose}
default-value:
${maven.verbose}

runOnce

protected boolean runOnce
Un flag pour ne lancer le plugin qu'une seule fois par build.

Note: Par défaut, la valeur est à true car il ne parrâit pas nécessaire de rejouer le mojo à chaque fois.

Since:
1.1.0
Is defined by:
expression:
${helper.runOnce}
default-value:
true

sec

protected org.sonatype.plexus.components.sec.dispatcher.SecDispatcher sec
password decypher

Since:
1.1.0
Is a Plexus component defined by:
roleHint:
maven-helper-plugin
Constructor Detail

ShareServerSecretPlugin

public ShareServerSecretPlugin()
Method Detail

init

protected void init()
             throws java.lang.Exception
Description copied from class: AbstractPlugin
Method to initialize the mojo before doing any concrete actions.

Note: The method is invoked before the AbstractPlugin.doAction() method.

// * @return true if mojo is well initialize and something has // * to be done in the AbstractPlugin.doAction() method, false // * otherwise.

Specified by:
init in class AbstractPlugin
Throws:
java.lang.Exception - if any

checkSkip

protected boolean checkSkip()
Description copied from class: AbstractPlugin
Checks if the mojo execution should be skipped.

Overrides:
checkSkip in class AbstractPlugin
Returns:
false if the mojo should not be executed.

doAction

protected void doAction()
                 throws java.lang.Exception
Description copied from class: AbstractPlugin
Do plugin action.

The method AbstractPlugin.execute() invoke this method only and only if :

Specified by:
doAction in class AbstractPlugin
Throws:
java.lang.Exception - if any

getProject

public org.apache.maven.project.MavenProject getProject()

setProject

public void setProject(org.apache.maven.project.MavenProject project)

isVerbose

public boolean isVerbose()

setVerbose

public void setVerbose(boolean verbose)

getPassphraseOut

public java.lang.String getPassphraseOut()

setPassphraseOut

public void setPassphraseOut(java.lang.String passphraseOut)

getPasswordOut

public java.lang.String getPasswordOut()

setPasswordOut

public void setPasswordOut(java.lang.String passwordOut)

getPrivateKeyOut

public java.lang.String getPrivateKeyOut()

setPrivateKeyOut

public void setPrivateKeyOut(java.lang.String privateKeyOut)

getUsernameOut

public java.lang.String getUsernameOut()

setUsernameOut

public void setUsernameOut(java.lang.String usernameOut)

getServerId

public java.lang.String getServerId()

setServerId

public void setServerId(java.lang.String serverId)


Copyright © 2009-2010 CodeLutin. All Rights Reserved.