org.nuiton.mail.plugin
Class SendEmailMojo

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

public class SendEmailMojo
extends AbstractPlugin

Send a email.

Since:
1.0.3
Author:
tchemit
Is defined by the goal name:
send-email
Requires to be online to run:
true
Requires a Maven project to run:
true

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
Plugin.Packaging
 
Field Summary
protected  boolean dryRun
          A flag to test plugin but send nothing to redmine.
protected  String encoding
          The encoding used to read and write files.
protected  org.apache.maven.project.MavenProject project
          Dependance du projet.
protected  org.apache.maven.settings.Settings settings
          Dependance du settings.
protected  boolean verbose
          Un flag pour activer le mode verbeux.
 
Fields inherited from class org.nuiton.plugin.AbstractPlugin
skipAfterInitMessage
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
SendEmailMojo()
           
 
Method Summary
protected  ProjectJavamailMailSender createMailer()
           
protected  org.codehaus.plexus.mailsender.MailMessage createMessage(String newsContent, MailSender mailSender)
           
protected  void doAction()
          Do plugin action.
 org.apache.maven.project.MavenProject getProject()
           
protected  boolean init()
          Method to initialize the mojo before doing any concrete actions.
protected  boolean isExecutionRoot()
           
protected  boolean isGoalSkip()
           
 boolean isVerbose()
           
 void setFrom(List<org.apache.maven.model.Developer> from)
           
 void setMailSender(MailSender sender)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setToAddresses(List<String> toAddresses)
           
 void setVerbose(boolean verbose)
           
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, checkPackaging, checkResource, copyFile, execute, getFilesToTreate, getFilesToTreateForRoots, getTemplate, initClassLoader, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, 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.0.3
Is defined by:
default-value:
${project}
Is readonly.
Is required.

settings

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

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

verbose

protected boolean verbose
Un flag pour activer le mode verbeux.

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

encoding

protected String encoding
The encoding used to read and write files.

Since:
1.0.3
Is defined by:
expression:
${helper.encoding}
default-value:
${project.build.sourceEncoding}

dryRun

protected boolean dryRun
A flag to test plugin but send nothing to redmine.

Since:
1.0.3
Is defined by:
expression:
${dryRun}
default-value:
false
Constructor Detail

SendEmailMojo

public SendEmailMojo()
Method Detail

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)

init

protected boolean init()
                throws 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.

Specified by:
init in class AbstractPlugin
Returns:
true if mojo is well initialize and something has to be done in the AbstractPlugin.doAction() method, false otherwise.
Throws:
Exception - if any

doAction

protected void doAction()
                 throws 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:
Exception - if any

isGoalSkip

protected boolean isGoalSkip()

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

protected ProjectJavamailMailSender createMailer()

setMailSender

public void setMailSender(MailSender sender)

setFrom

public void setFrom(List<org.apache.maven.model.Developer> from)

setToAddresses

public void setToAddresses(List<String> toAddresses)

isExecutionRoot

protected boolean isExecutionRoot()


Copyright © 2009 CodeLutin. All Rights Reserved.