org.apache.maven.plugin.announcement
Class AnnouncementMailMojo

java.lang.Object
  extended byorg.apache.maven.plugin.AbstractMojo
      extended byorg.apache.maven.plugin.announcement.AnnouncementMailMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class AnnouncementMailMojo
extends org.apache.maven.plugin.AbstractMojo

Goal which sends an announcement through email.

Version:
$Id: AnnouncementMailMojo.html 816584 2012-05-08 12:33:35Z hboutemy $
Author:
aramirez@exist.com

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AnnouncementMailMojo()
           
 
Method Summary
 void execute()
           
protected  MailSender getActualMailSender()
          Returns the identify of the mail sender according to the plugin's configuration: if the mailSender parameter is set, it is returned if no fromDeveloperId is set, the first developer in the list is returned if a fromDeveloperId is set, the developer with that id is returned if the developers list is empty or if the specified id does not exist, an exception is thrown
 List getFrom()
           
 String getFromDeveloperId()
           
 MailSender getMailSender()
           
 String getPassword()
           
 org.apache.maven.project.MavenProject getProject()
           
 String getSmtpHost()
           
 int getSmtpPort()
           
 String getSubject()
           
 String getTemplate()
           
 File getTemplateOutputDirectory()
           
 List getToAddresses()
           
 String getUsername()
           
 boolean isSslMode()
           
protected  FileReader readAnnouncement(File file)
          Read the announcement generated file.
protected  void sendMessage()
          Send the email.
 void setFrom(List from)
           
 void setFromDeveloperId(String fromDeveloperId)
           
 void setMailSender(MailSender mailSender)
           
 void setPassword(String password)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setSmtpHost(String smtpHost)
           
 void setSmtpPort(int smtpPort)
           
 void setSslMode(boolean sslMode)
           
 void setSubject(String subject)
           
 void setTemplate(String template)
           
 void setTemplateOutputDirectory(File templateOutputDirectory)
           
 void setToAddresses(List toAddresses)
           
 void setUsername(String username)
           
 
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
 

Constructor Detail

AnnouncementMailMojo

public AnnouncementMailMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

sendMessage

protected void sendMessage()
                    throws org.apache.maven.plugin.MojoExecutionException
Send the email.

Throws:
org.apache.maven.plugin.MojoExecutionException - if the mail could not be sent

readAnnouncement

protected FileReader readAnnouncement(File file)
                               throws org.apache.maven.plugin.MojoExecutionException
Read the announcement generated file.

Parameters:
file - the file to be read
Returns:
fileReader Return the FileReader
Throws:
org.apache.maven.plugin.MojoExecutionException - if the file could not be found

getActualMailSender

protected MailSender getActualMailSender()
                                  throws org.apache.maven.plugin.MojoExecutionException
Returns the identify of the mail sender according to the plugin's configuration:

Returns:
the mail sender to use
Throws:
org.apache.maven.plugin.MojoExecutionException - if the mail sender could not be retrieved

getSmtpHost

public String getSmtpHost()

setSmtpHost

public void setSmtpHost(String smtpHost)

getSmtpPort

public int getSmtpPort()

setSmtpPort

public void setSmtpPort(int smtpPort)

getSubject

public String getSubject()

setSubject

public void setSubject(String subject)

getFrom

public List getFrom()

setFrom

public void setFrom(List from)

getProject

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

setProject

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

getToAddresses

public List getToAddresses()

setToAddresses

public void setToAddresses(List toAddresses)

getFromDeveloperId

public String getFromDeveloperId()

setFromDeveloperId

public void setFromDeveloperId(String fromDeveloperId)

getUsername

public String getUsername()

setUsername

public void setUsername(String username)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

isSslMode

public boolean isSslMode()

setSslMode

public void setSslMode(boolean sslMode)

getMailSender

public MailSender getMailSender()

setMailSender

public void setMailSender(MailSender mailSender)

getTemplateOutputDirectory

public File getTemplateOutputDirectory()

setTemplateOutputDirectory

public void setTemplateOutputDirectory(File templateOutputDirectory)

getTemplate

public String getTemplate()

setTemplate

public void setTemplate(String template)


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.