Class ShareServerSecretPlugin

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

@Mojo(name="share-server-secret", defaultPhase=INITIALIZE, requiresProject=true) public class ShareServerSecretPlugin extends org.nuiton.plugin.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:
Tony Chemit - chemit@codelutin.com
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     

    Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin

    org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The name of the property where to export the passphrase of the server.
    protected String
    The name of the property where to export the password of the server.
    protected String
    The name of the property where to export the private key of the server.
    protected org.apache.maven.project.MavenProject
    Project.
    protected boolean
    A flag to execute only once the mojo.
    protected boolean
    A flag to restrict only to run on root module.
    protected org.sonatype.plexus.components.sec.dispatcher.SecDispatcher
    password decypher
    protected String
    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.
    protected boolean
    A flag to skip null values.
    protected boolean
    A flag to skip the goal.
    protected String
    The name of the property where to export the username of the server.
    protected boolean
    A flag to activate verbose mode.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected void
     
     
     
     
    org.apache.maven.project.MavenProject
     
     
     
    void
     
    protected boolean
     
    boolean
     
    void
    setPassphraseOut(String passphraseOut)
     
    void
    setPasswordOut(String passwordOut)
     
    void
    setPrivateKeyOut(String privateKeyOut)
     
    void
    setProject(org.apache.maven.project.MavenProject project)
     
    void
    setRunOnce(boolean runOnce)
     
    void
    setSec(org.sonatype.plexus.components.sec.dispatcher.SecDispatcher sec)
     
    void
    setServerId(String serverId)
     
    void
    setSettings(org.apache.maven.settings.Settings settings)
     
    void
    setUsernameOut(String usernameOut)
     
    void
    setVerbose(boolean verbose)
     

    Methods inherited from class org.nuiton.plugin.AbstractPlugin

    acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, 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 Details

    • project

      @Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject project
      Project.
      Since:
      1.1.0
    • settings

      @Parameter(defaultValue="${settings}", required=true, readonly=true) protected org.apache.maven.settings.Settings settings
      Settings.
      Since:
      1.1.0
    • serverId

      @Parameter(property="helper.serverId", required=true) protected 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
    • usernameOut

      @Parameter protected 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
    • passwordOut

      @Parameter protected 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
    • passphraseOut

      @Parameter protected 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
    • privateKeyOut

      @Parameter protected 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
    • verbose

      @Parameter(property="helper.verbose", defaultValue="${maven.verbose}") protected boolean verbose
      A flag to activate verbose mode.
      Since:
      1.1.0
    • runOnce

      @Parameter(property="helper.runOnce", defaultValue="true") protected boolean runOnce
      A flag to execute only once the mojo. Note: By default, value is true since it is not necessary to inject twice secrets in session.
      Since:
      1.1.0
    • runOnlyOnRoot

      @Parameter(property="helper.runOnlyOnRoot", defaultValue="false") protected boolean runOnlyOnRoot
      A flag to restrict only to run on root module.
      Since:
      2.1
    • skipShareServerSecret

      @Parameter(property="helper.skipShareServerSecret", defaultValue="false") protected boolean skipShareServerSecret
      A flag to skip the goal.
      Since:
      2.1
    • skipNullValues

      @Parameter(property="helper.skipNullValues", defaultValue="false") protected boolean skipNullValues
      A flag to skip null values.
      Since:
      1.6
    • sec

      @Component(hint="maven-helper-plugin") protected org.sonatype.plexus.components.sec.dispatcher.SecDispatcher sec
      password decypher
      Since:
      1.1.0
  • Constructor Details

    • ShareServerSecretPlugin

      public ShareServerSecretPlugin()
  • Method Details

    • init

      public void init() throws Exception
      Specified by:
      init in class org.nuiton.plugin.AbstractPlugin
      Throws:
      Exception
    • checkSkip

      public boolean checkSkip()
      Overrides:
      checkSkip in class org.nuiton.plugin.AbstractPlugin
    • doAction

      protected void doAction() throws Exception
      Specified by:
      doAction in class org.nuiton.plugin.AbstractPlugin
      Throws:
      Exception
    • 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 String getPassphraseOut()
    • setPassphraseOut

      public void setPassphraseOut(String passphraseOut)
    • getPasswordOut

      public String getPasswordOut()
    • setPasswordOut

      public void setPasswordOut(String passwordOut)
    • getPrivateKeyOut

      public String getPrivateKeyOut()
    • setPrivateKeyOut

      public void setPrivateKeyOut(String privateKeyOut)
    • getUsernameOut

      public String getUsernameOut()
    • setUsernameOut

      public void setUsernameOut(String usernameOut)
    • getServerId

      public String getServerId()
    • setServerId

      public void setServerId(String serverId)
    • setSec

      public void setSec(org.sonatype.plexus.components.sec.dispatcher.SecDispatcher sec)
    • setSettings

      public void setSettings(org.apache.maven.settings.Settings settings)
    • setRunOnce

      public void setRunOnce(boolean runOnce)
    • isGoalSkip

      protected boolean isGoalSkip()