Class SendEmailMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.helper.plugin.SendEmailMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
@Mojo(name="send-email",
requiresOnline=true,
requiresProject=true)
public class SendEmailMojo
extends org.nuiton.plugin.AbstractPlugin
implements org.nuiton.plugin.PluginWithEncoding
Send a email.
- Since:
- 1.0.3
- Author:
- Tony Chemit - chemit@codelutin.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanA flag to test plugin but send nothing to redmine.protected FileThe Velocity template used to format the email announcement.protected StringThe title of the email to send.protected StringThe encoding used to read and write files.protected List<org.apache.maven.model.Developer> Possible senders.protected StringThe id of the developer sending the announcement mail.protected StringMail content type to use.protected MailSenderDefines the sender of the announcement if the list of developer is empty or if the sender is not a member of the development team.protected StringThe password used to send the email.protected org.apache.maven.project.MavenProjectDependance du projet.protected booleanA flag to restirct only one run in a build (for multi-module context).protected booleanA flag to restrict only to run on root module.protected booleanA flag to skip the goal.protected StringSmtp Server.protected intPort.protected booleanIf the email should be sent in SSL mode.Recipient email address.protected StringThe username used to send the email.protected booleanUn flag pour activer le mode verbeux.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected ProjectJavamailMailSenderprotected org.codehaus.plexus.mailsender.MailMessagecreateMessage(String newsContent, MailSender mailSender) protected voiddoAction()org.apache.maven.project.MavenProject//////////////////////////////////////////////////////////////////////// Plugin ////////////////////////////////////////////////////////////////////////protected voidinit()//////////////////////////////////////////////////////////////////////// AbstractPlugin ////////////////////////////////////////////////////////////////////////protected booleanprotected boolean//////////////////////////////////////////////////////////////////////// Other ////////////////////////////////////////////////////////////////////////booleanvoidsetEncoding(String encoding) voidvoidsetMailSender(MailSender mailSender) voidsetProject(org.apache.maven.project.MavenProject project) voidsetToAddresses(List<String> toAddresses) 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, 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
execute, getLog, setLog
-
Field Details
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject projectDependance du projet.- Since:
- 1.0.3
-
verbose
@Parameter(property="helper.verbose", defaultValue="${maven.verbose}") protected boolean verboseUn flag pour activer le mode verbeux.- Since:
- 1.0.3
-
emailContentFile
The Velocity template used to format the email announcement.- Since:
- 1.0.3
-
emailTitle
The title of the email to send.- Since:
- 1.0.3
-
smtpHost
Smtp Server.- Since:
- 1.0.3
-
smtpPort
@Parameter(property="helper.smtpPort", defaultValue="25", required=true) protected int smtpPortPort.- Since:
- 1.0.3
-
username
The username used to send the email.- Since:
- 1.0.3
-
password
The password used to send the email.- Since:
- 1.0.3
-
sslMode
@Parameter(property="helper.sslMode", defaultValue="false") protected boolean sslModeIf the email should be sent in SSL mode.- Since:
- 1.0.3
-
fromDeveloperId
The id of the developer sending the announcement mail. Only used if the mailSender attribute is not set. In this case, this should match the id of one of the developers in the pom. If a matching developer is not found, then the first developer in the pom will be used.- Since:
- 1.0.3
-
mailSender
Defines the sender of the announcement if the list of developer is empty or if the sender is not a member of the development team.- Since:
- 1.0.3
-
toAddresses
-
from
@Parameter(property="project.developers", required=true, readonly=true) protected List<org.apache.maven.model.Developer> fromPossible senders.- Since:
- 1.0.3
-
mailContentType
Mail content type to use.- Since:
- 1.0.3
-
encoding
@Parameter(property="helper.encoding", defaultValue="${project.build.sourceEncoding}") protected String encodingThe encoding used to read and write files.- Since:
- 1.0.3
-
skipSendEmail
@Parameter(property="helper.skipSendEmail", defaultValue="false") protected boolean skipSendEmailA flag to skip the goal.- Since:
- 1.0.3
-
dryRun
@Parameter(property="dryRun", defaultValue="false") protected boolean dryRunA flag to test plugin but send nothing to redmine.- Since:
- 1.0.3
-
runOnce
@Parameter(property="helper.runOnce", defaultValue="true") protected boolean runOnceA flag to restirct only one run in a build (for multi-module context).- Since:
- 1.0.3
-
runOnlyOnRoot
@Parameter(property="helper.runOnlyOnRoot", defaultValue="true") protected boolean runOnlyOnRootA flag to restrict only to run on root module.- Since:
- 2.1
-
-
Constructor Details
-
SendEmailMojo
public SendEmailMojo()
-
-
Method Details
-
getProject
public org.apache.maven.project.MavenProject getProject()//////////////////////////////////////////////////////////////////////// Plugin ////////////////////////////////////////////////////////////////////////- Specified by:
getProjectin interfaceorg.nuiton.plugin.Plugin
-
setProject
public void setProject(org.apache.maven.project.MavenProject project) - Specified by:
setProjectin interfaceorg.nuiton.plugin.Plugin
-
isVerbose
public boolean isVerbose()- Specified by:
isVerbosein interfaceorg.nuiton.plugin.Plugin
-
setVerbose
public void setVerbose(boolean verbose) - Specified by:
setVerbosein interfaceorg.nuiton.plugin.Plugin
-
init
-
checkSkip
protected boolean checkSkip()- Overrides:
checkSkipin classorg.nuiton.plugin.AbstractPlugin
-
doAction
-
isGoalSkip
protected boolean isGoalSkip()//////////////////////////////////////////////////////////////////////// Other //////////////////////////////////////////////////////////////////////// -
createMessage
protected org.codehaus.plexus.mailsender.MailMessage createMessage(String newsContent, MailSender mailSender) throws org.codehaus.plexus.mailsender.MailSenderException - Throws:
org.codehaus.plexus.mailsender.MailSenderException
-
createMailer
-
setMailSender
-
setFrom
-
setToAddresses
-
isExecutionRoot
protected boolean isExecutionRoot()- Overrides:
isExecutionRootin classorg.nuiton.plugin.AbstractPlugin
-
getEncoding
- Specified by:
getEncodingin interfaceorg.nuiton.plugin.PluginWithEncoding
-
setEncoding
- Specified by:
setEncodingin interfaceorg.nuiton.plugin.PluginWithEncoding
-