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
runOnlyAtExecutionRoot
Fields inherited from class org.apache.maven.plugins.changes.AbstractChangesMojo
basedir, mavenSession
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
protected MailSender
Returns the identify of the mail sender according to the plugin's configuration: if themailSender
parameter is set, it is returned if nofromDeveloperId
is set, the first developer in the list is returned if afromDeveloperId
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 thrownList
<org.apache.maven.model.Developer> getFrom()
org.apache.maven.project.MavenProject
int
boolean
boolean
protected String
readAnnouncement
(File file) Read the content of the generated announcement file.protected void
Send the email.void
setAnnouncementDirectory
(File announcementDirectory) void
setAnnouncementFile
(String announcementFile) void
setBccAddresses
(List<Object> bccAddresses) void
setCcAddresses
(List<Object> ccAddresses) void
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
setStartTls
(boolean startTls) void
setSubject
(String subject) void
setToAddresses
(List<Object> toAddresses) void
setUsername
(String username) Methods inherited from class org.apache.maven.plugins.changes.AbstractChangesMojo
isThisTheExecutionRoot
Methods 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
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
- 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
-