Class AnnouncementMailMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.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$
Author:
aramirez@exist.com
  • Constructor Details

    • AnnouncementMailMojo

      public AnnouncementMailMojo()
  • Method Details

    • 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 String readAnnouncement(File file) throws org.apache.maven.plugin.MojoExecutionException
      Read the content of the generated announcement file.
      Parameters:
      file - the file to be read
      Returns:
      Return the announcement text
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the file could not be found, or if the encoding is unsupported
    • getActualMailSender

      protected MailSender getActualMailSender() throws org.apache.maven.plugin.MojoExecutionException
      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
      Returns:
      the mail sender to use
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the mail sender could not be retrieved
    • getBccAddresses

      public List<Object> getBccAddresses()
    • setBccAddresses

      public void setBccAddresses(List<Object> bccAddresses)
    • getCcAddresses

      public List<Object> getCcAddresses()
    • setCcAddresses

      public void setCcAddresses(List<Object> ccAddresses)
    • getFrom

      public List<org.apache.maven.model.Developer> getFrom()
    • setFrom

      public void setFrom(List<org.apache.maven.model.Developer> 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 org.apache.maven.project.MavenProject getProject()
    • setProject

      public void setProject(org.apache.maven.project.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<Object> getToAddresses()
    • setToAddresses

      public void setToAddresses(List<Object> toAddresses)
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)