Class AnnouncementMailMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.changes.AbstractChangesMojo
org.apache.maven.plugins.changes.announcement.AbstractAnnouncementMojo
org.apache.maven.plugins.changes.announcement.AnnouncementMailMojo
- 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
-
Field Summary
Fields inherited from class org.apache.maven.plugins.changes.announcement.AbstractAnnouncementMojo
runOnlyAtExecutionRootFields inherited from class org.apache.maven.plugins.changes.AbstractChangesMojo
basedir, mavenSessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected MailSenderReturns the identify of the mail sender according to the plugin's configuration: if themailSenderparameter is set, it is returned if nofromDeveloperIdis set, the first developer in the list is returned if afromDeveloperIdis 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 thrownList<org.apache.maven.model.Developer> getFrom()org.apache.maven.project.MavenProjectintbooleanbooleanprotected StringreadAnnouncement(File file) Read the content of the generated announcement file.protected voidSend the email.voidsetAnnouncementDirectory(File announcementDirectory) voidsetAnnouncementFile(String announcementFile) voidsetBccAddresses(List<Object> bccAddresses) voidsetCcAddresses(List<Object> ccAddresses) voidvoidsetFromDeveloperId(String fromDeveloperId) voidsetMailSender(MailSender mailSender) voidsetPassword(String password) voidsetProject(org.apache.maven.project.MavenProject project) voidsetSmtpHost(String smtpHost) voidsetSmtpPort(int smtpPort) voidsetSslMode(boolean sslMode) voidsetStartTls(boolean startTls) voidsetSubject(String subject) voidsetToAddresses(List<Object> toAddresses) voidsetUsername(String username) Methods inherited from class org.apache.maven.plugins.changes.AbstractChangesMojo
isThisTheExecutionRootMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
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.MojoExecutionExceptionSend the email.- Throws:
org.apache.maven.plugin.MojoExecutionException- if the mail could not be sent
-
readAnnouncement
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
Returns the identify of the mail sender according to the plugin's configuration:- if the
mailSenderparameter is set, it is returned - if no
fromDeveloperIdis set, the first developer in the list is returned - if a
fromDeveloperIdis 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
- if the
-
getBccAddresses
-
setBccAddresses
-
getCcAddresses
-
setCcAddresses
-
getFrom
-
setFrom
-
getFromDeveloperId
-
setFromDeveloperId
-
getMailSender
-
setMailSender
-
getPassword
-
setPassword
-
getProject
public org.apache.maven.project.MavenProject getProject() -
setProject
public void setProject(org.apache.maven.project.MavenProject project) -
getSmtpHost
-
setSmtpHost
-
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
-
setSubject
-
getAnnouncementFile
-
setAnnouncementFile
-
getAnnouncementDirectory
-
setAnnouncementDirectory
-
getToAddresses
-
setToAddresses
-
getUsername
-
setUsername
-