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 ClassesNested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe name of the property where to export the passphrase of the server.protected StringThe name of the property where to export the password of the server.protected StringThe name of the property where to export the private key of the server.protected org.apache.maven.project.MavenProjectProject.protected booleanA flag to execute only once the mojo.protected booleanA flag to restrict only to run on root module.protected org.sonatype.plexus.components.sec.dispatcher.SecDispatcherpassword decypherprotected StringServer 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.SettingsSettings.protected booleanA flag to skip null values.protected booleanA flag to skip the goal.protected StringThe name of the property where to export the username of the server.protected booleanA flag to activate verbose mode.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected voiddoAction()org.apache.maven.project.MavenProjectvoidinit()protected booleanbooleanvoidsetPassphraseOut(String passphraseOut) voidsetPasswordOut(String passwordOut) voidsetPrivateKeyOut(String privateKeyOut) voidsetProject(org.apache.maven.project.MavenProject project) voidsetRunOnce(boolean runOnce) voidsetSec(org.sonatype.plexus.components.sec.dispatcher.SecDispatcher sec) voidsetServerId(String serverId) voidsetSettings(org.apache.maven.settings.Settings settings) voidsetUsernameOut(String usernameOut) voidsetVerbose(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, writeFileMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 projectProject.- Since:
- 1.1.0
-
settings
@Parameter(defaultValue="${settings}", required=true, readonly=true) protected org.apache.maven.settings.Settings settingsSettings.- Since:
- 1.1.0
-
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
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
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
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
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 verboseA flag to activate verbose mode.- Since:
- 1.1.0
-
runOnce
@Parameter(property="helper.runOnce", defaultValue="true") protected boolean runOnceA flag to execute only once the mojo. Note: By default, value istruesince it is not necessary to inject twice secrets in session.- Since:
- 1.1.0
-
runOnlyOnRoot
@Parameter(property="helper.runOnlyOnRoot", defaultValue="false") protected boolean runOnlyOnRootA flag to restrict only to run on root module.- Since:
- 2.1
-
skipNullValues
@Parameter(property="helper.skipNullValues", defaultValue="false") protected boolean skipNullValuesA flag to skip null values.- Since:
- 1.6
-
sec
@Component(hint="maven-helper-plugin") protected org.sonatype.plexus.components.sec.dispatcher.SecDispatcher secpassword decypher- Since:
- 1.1.0
-
-
Constructor Details
-
ShareServerSecretPlugin
public ShareServerSecretPlugin()
-
-
Method Details
-
init
-
checkSkip
public boolean checkSkip()- Overrides:
checkSkipin classorg.nuiton.plugin.AbstractPlugin
-
doAction
-
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
-
setPassphraseOut
-
getPasswordOut
-
setPasswordOut
-
getPrivateKeyOut
-
setPrivateKeyOut
-
getUsernameOut
-
setUsernameOut
-
getServerId
-
setServerId
-
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()
-