org.apache.maven.plugin.announcement
Class AnnouncementMailMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.changes.AbstractChangesMojo
          extended by org.apache.maven.plugin.announcement.AbstractAnnouncementMojo
              extended by org.apache.maven.plugin.announcement.AnnouncementMailMojo
All Implemented Interfaces:
ContextEnabled, Mojo

@Mojo(name="announcement-mail",
      threadSafe=true)
@Execute(goal="announcement-generate")
public class AnnouncementMailMojo
extends AbstractAnnouncementMojo

Goal which sends an announcement through email.

Since:
2.0-beta-2
Version:
$Id: AnnouncementMailMojo.java 1579078 2014-03-18 22:44:41Z dennisl $
Author:
aramirez@exist.com

Field Summary
 
Fields inherited from class org.apache.maven.plugin.announcement.AbstractAnnouncementMojo
runOnlyAtExecutionRoot
 
Fields inherited from class org.apache.maven.plugin.changes.AbstractChangesMojo
basedir, mavenSession
 
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
 File getAnnouncementDirectory()
           
 String getAnnouncementFile()
           
 List getBccAddresses()
           
 List getCcAddresses()
           
 List getFrom()
           
 String getFromDeveloperId()
           
 MailSender getMailSender()
           
 String getPassword()
           
 MavenProject getProject()
           
 String getSmtpHost()
           
 int getSmtpPort()
           
 String getSubject()
           
 List getToAddresses()
           
 String getUsername()
           
 boolean isSslMode()
           
 boolean isStartTls()
           
protected  String readAnnouncement(File file)
          Read the content of the generated announcement file.
protected  void sendMessage()
          Send the email.
 void setAnnouncementDirectory(File announcementDirectory)
           
 void setAnnouncementFile(String announcementFile)
           
 void setBccAddresses(List bccAddresses)
           
 void setCcAddresses(List ccAddresses)
           
 void setFrom(List from)
           
 void setFromDeveloperId(String fromDeveloperId)
           
 void setMailSender(MailSender mailSender)
           
 void setPassword(String password)
           
 void setProject(MavenProject project)
           
 void setSmtpHost(String smtpHost)
           
 void setSmtpPort(int smtpPort)
           
 void setSslMode(boolean sslMode)
           
 void setStartTls(boolean startTls)
           
 void setSubject(String subject)
           
 void setToAddresses(List toAddresses)
           
 void setUsername(String username)
           
 
Methods inherited from class org.apache.maven.plugin.changes.AbstractChangesMojo
isThisTheExecutionRoot
 
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 MojoExecutionException
Throws:
MojoExecutionException

sendMessage

protected void sendMessage()
                    throws MojoExecutionException
Send the email.

Throws:
MojoExecutionException - if the mail could not be sent

readAnnouncement

protected String readAnnouncement(File file)
                           throws MojoExecutionException
Read the content of the generated announcement file.

Parameters:
file - the file to be read
Returns:
Return the announcement text
Throws:
MojoExecutionException - if the file could not be found, or if the encoding is unsupported

getActualMailSender

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

Returns:
the mail sender to use
Throws:
MojoExecutionException - if the mail sender could not be retrieved

getBccAddresses

public List getBccAddresses()

setBccAddresses

public void setBccAddresses(List bccAddresses)

getCcAddresses

public List getCcAddresses()

setCcAddresses

public void setCcAddresses(List ccAddresses)

getFrom

public List getFrom()

setFrom

public void setFrom(List from)

getFromDeveloperId

public String getFromDeveloperId()

setFromDeveloperId

public void setFromDeveloperId(String fromDeveloperId)

getMailSender

public MailSender getMailSender()

setMailSender

public void setMailSender(MailSender mailSender)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getProject

public MavenProject getProject()

setProject

public void setProject(MavenProject project)

getSmtpHost

public String getSmtpHost()

setSmtpHost

public void setSmtpHost(String smtpHost)

getSmtpPort

public int getSmtpPort()

setSmtpPort

public void setSmtpPort(int smtpPort)

isSslMode

public boolean isSslMode()

setSslMode

public void setSslMode(boolean sslMode)

isStartTls

public boolean isStartTls()

setStartTls

public void setStartTls(boolean startTls)

getSubject

public String getSubject()

setSubject

public void setSubject(String subject)

getAnnouncementFile

public String getAnnouncementFile()

setAnnouncementFile

public void setAnnouncementFile(String announcementFile)

getAnnouncementDirectory

public File getAnnouncementDirectory()

setAnnouncementDirectory

public void setAnnouncementDirectory(File announcementDirectory)

getToAddresses

public List getToAddresses()

setToAddresses

public void setToAddresses(List toAddresses)

getUsername

public String getUsername()

setUsername

public void setUsername(String username)


Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.