@Mojo(name="announcement-mail", threadSafe=true) @Execute(goal="announcement-generate") public class AnnouncementMailMojo extends AbstractAnnouncementMojo
runOnlyAtExecutionRoot
basedir, mavenSession
Constructor and Description |
---|
AnnouncementMailMojo() |
Modifier and Type | Method and Description |
---|---|
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) |
isThisTheExecutionRoot
getLog, getPluginContext, setLog, setPluginContext
public void execute() throws MojoExecutionException
MojoExecutionException
protected void sendMessage() throws MojoExecutionException
MojoExecutionException
- if the mail could not be sentprotected String readAnnouncement(File file) throws MojoExecutionException
file
- the file to be readMojoExecutionException
- if the file could not be found, or if the encoding is unsupportedprotected MailSender getActualMailSender() throws MojoExecutionException
MojoExecutionException
- if the mail sender could not be retrievedpublic List getBccAddresses()
public void setBccAddresses(List bccAddresses)
public List getCcAddresses()
public void setCcAddresses(List ccAddresses)
public List getFrom()
public void setFrom(List from)
public String getFromDeveloperId()
public void setFromDeveloperId(String fromDeveloperId)
public MailSender getMailSender()
public void setMailSender(MailSender mailSender)
public String getPassword()
public void setPassword(String password)
public MavenProject getProject()
public void setProject(MavenProject project)
public String getSmtpHost()
public void setSmtpHost(String smtpHost)
public int getSmtpPort()
public void setSmtpPort(int smtpPort)
public boolean isSslMode()
public void setSslMode(boolean sslMode)
public boolean isStartTls()
public void setStartTls(boolean startTls)
public String getSubject()
public void setSubject(String subject)
public String getAnnouncementFile()
public void setAnnouncementFile(String announcementFile)
public File getAnnouncementDirectory()
public void setAnnouncementDirectory(File announcementDirectory)
public List getToAddresses()
public void setToAddresses(List toAddresses)
public String getUsername()
public void setUsername(String username)
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.