org.nuiton.jredmine.plugin.announcement
Class AbstractAnnouncementMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.jredmine.plugin.AbstractRedmineMojo
              extended by org.nuiton.jredmine.plugin.announcement.AbstractAnnouncementMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.io.rest.RestClientConfiguration, AnnouncementGeneratorConfiguration, org.nuiton.plugin.Plugin
Direct Known Subclasses:
GenerateEmailAnnouncementMojo, GenerateNewsAnnouncementMojo

public abstract class AbstractAnnouncementMojo
extends AbstractRedmineMojo
implements AnnouncementGeneratorConfiguration

Author:
chemit
Requires to be online to run:
true

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected  Map<String,Object> announceParameters
          Map which will be pass to the velocity context
protected  boolean anonymous
          Flag to know if anonymùous connexion to redmine server is required.
protected  String artifactId
           
protected  File artifactsFile
           
protected  Map<File,String> artifactUrls
           
protected  String attachmentLinkTemplate
          Template strings per system that is used to discover the URL to use to display an attchment.
protected  Attachment[] attachments
           
protected  Map<Attachment,String> attachmentUrls
           
protected  String basedir
          The current project base directory.
protected  String deploymentUrl
           
protected  String developmentTeam
          Name of the team that develops the artifact.
protected  String finalName
          The name of the artifact to be used in the announcement.
protected  AnnouncementGenerator generator
           
protected  String groupId
           
protected  String introduction
          Short description or introduction of the released artifact.
protected  String packaging
          Packaging structure for the artifact.
protected  String projectUrl
          Distribution url of the artifact.
protected  List<?> releases
           
protected  boolean runOnce
          A flag to restirct only one run in a build (for multi-module context).
protected  String templateDirectory
          Directory that contains the template.
protected  String templateEncoding
          The template encoding.
protected  File templateOutputDirectory
          Directory where the template file will be generated.
protected  String urlDownload
          URL where the artifact can be downloaded.
protected  org.codehaus.plexus.velocity.VelocityComponent velocity
          Velocity Component.
protected  File xmlPath
          The path of the changes.xml file.
 
Fields inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
dateFormat, encoding, initOk, password, project, projectId, REDMINE_SYSTEM, releaseProject, releaseUser, releaseVersion, runOnceDone, safe, service, serviceInit, session, url, username, users, verbose, versionId
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
protected AbstractAnnouncementMojo()
           
 
Method Summary
protected  boolean checkRunOnceDone()
           
protected  void doAction()
          Re-expose the protected method for test purposes...
protected abstract  String getAnnouncementTemplate()
           
 Map<String,Object> getAnnounceParameters()
           
 String getArtifactId()
           
 Map<File,String> getArtifactUrls()
           
 String getAttachmentLinkTemplate()
           
 Map<Attachment,String> getAttachmentUrls()
           
 String getBasedir()
           
 String getDeploymentUrl()
           
 String getDevelopmentTeam()
           
 String getFinalName()
           
 String getGroupId()
           
 String getIntroduction()
           
 String getPackaging()
           
 String getProjectUrl()
           
 String getUrl()
           
 String getUrlDownload()
           
protected  void init()
           
 boolean isAnonymous()
           
protected  boolean isRunOnce()
           
 void setAnonymous(boolean anonymous)
           
 
Methods inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
afterExecute, checkSkip, closeService, getEncoding, getProject, getProjectId, getRestPassword, getRestUrl, getRestUsername, getVersionId, initReleaseProject, initReleaseUser, initReleaseVersion, isGoalSkip, isRunOnceDone, isSafe, isVerbose, setEncoding, setProject, setRestPassword, setRestUrl, setRestUsername, setSafe, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, backupFile, checkEncoding, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile
 
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
 
Methods inherited from interface org.nuiton.jredmine.plugin.announcement.AnnouncementGeneratorConfiguration
getLog, getProject, getVersionId
 
Methods inherited from interface org.apache.maven.plugin.Mojo
getLog, setLog
 

Field Detail

anonymous

protected boolean anonymous
Flag to know if anonymùous connexion to redmine server is required.

For this goal, the default value is true

Note: If set to false, you should fill AbstractRedmineMojo.username and AbstractRedmineMojo.password properties.

Since:
1.1.3
Is defined by:
expression:
${redmine.anonymous}
default-value:
true

templateOutputDirectory

protected File templateOutputDirectory
Directory where the template file will be generated.

Since:
1.0.0
Is defined by:
expression:
${redmine.templateOutputDirectory}
default-value:
${project.build.directory}/generated-sources/announcement
Is required.

xmlPath

protected File xmlPath
The path of the changes.xml file.

Since:
1.0.0
Is defined by:
expression:
${redmine.xmlPath}
default-value:
${basedir}/src/changes/changes.xml
Is required.

templateDirectory

protected String templateDirectory
Directory that contains the template.

Note: This directory must be a subdirectory of /src/main/resources/ or current project base directory.

Since:
1.0.0
Is defined by:
expression:
${redmine.templateDirectory}
default-value:
org/nuiton/jredmine/plugin/announcement
Is required.

templateEncoding

protected String templateEncoding
The template encoding.

Since:
1.0.0
Is defined by:
expression:
${redmine.templateEncoding}
default-value:
${project.build.sourceEncoding}

announceParameters

protected Map<String,Object> announceParameters
Map which will be pass to the velocity context

Since:
1.0.0
Is defined by:

attachmentLinkTemplate

protected String attachmentLinkTemplate
Template strings per system that is used to discover the URL to use to display an attchment. Each key in this map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template.

There are 2 template tokens you can use. %URL%: this is computed by getting the <issueManagement>/<url> value from the POM, and removing the last '/' and everything that comes after it. %FILE%: this is the issue number.

Since:
1.0.0
Is defined by:
expression:
${redmine.attachmentLinkTemplate}
default-value:
%URL%/attachments/download/%FILE%

groupId

protected String groupId
Since:
1.0.0
Is defined by:
expression:
${project.groupId}
Is readonly.

artifactId

protected String artifactId
Since:
1.0.0
Is defined by:
expression:
${project.artifactId}
Is readonly.

projectUrl

protected String projectUrl
Distribution url of the artifact.

Since:
1.0.0
Is defined by:
expression:
${redmine.projectUrl}
default-value:
${project.url}
Is required.

packaging

protected String packaging
Packaging structure for the artifact.

Since:
1.0.0
Is defined by:
expression:
${project.packaging}
Is readonly.

finalName

protected String finalName
The name of the artifact to be used in the announcement.

Since:
1.0.0
Is defined by:
expression:
${redmine.finalName}
default-value:
${project.build.finalName}
Is required.

basedir

protected String basedir
The current project base directory.

Since:
1.0.0
Is defined by:
expression:
${basedir}
Is required.

urlDownload

protected String urlDownload
URL where the artifact can be downloaded. If not specified, no URL is used.

Since:
1.0.0
Is defined by:

developmentTeam

protected String developmentTeam
Name of the team that develops the artifact.

Since:
1.0.0
Is defined by:
expression:
${redmine.developmentTeam}
default-value:
${project.name}
Is required.

introduction

protected String introduction
Short description or introduction of the released artifact.

Since:
1.0.0
Is defined by:
expression:
${redmine.introduction}
default-value:
${project.description}

runOnce

protected boolean runOnce
A flag to restirct only one run in a build (for multi-module context).

Since:
1.0.0
Is defined by:
expression:
${redmine.runOnce}
default-value:
true

artifactsFile

protected File artifactsFile
Since:
1.2.1
Is defined by:
expression:
${redmine.artifactsFile}

deploymentUrl

protected String deploymentUrl
Is defined by:
expression:
${redmine.deploymentUrl}
Is readonly.

velocity

protected org.codehaus.plexus.velocity.VelocityComponent velocity
Velocity Component.

Is a Plexus component defined by:
roleHint:
maven-helper-plugin

attachments

protected Attachment[] attachments

artifactUrls

protected Map<File,String> artifactUrls

attachmentUrls

protected Map<Attachment,String> attachmentUrls

releases

protected List<?> releases

generator

protected AnnouncementGenerator generator
Constructor Detail

AbstractAnnouncementMojo

protected AbstractAnnouncementMojo()
Method Detail

getAnnouncementTemplate

protected abstract String getAnnouncementTemplate()
Returns:
the name fo the template to use

isAnonymous

public boolean isAnonymous()
Specified by:
isAnonymous in interface org.nuiton.io.rest.RestClientConfiguration

setAnonymous

public void setAnonymous(boolean anonymous)
Specified by:
setAnonymous in interface org.nuiton.io.rest.RestClientConfiguration

isRunOnce

protected boolean isRunOnce()
Specified by:
isRunOnce in class AbstractRedmineMojo

checkRunOnceDone

protected boolean checkRunOnceDone()
Specified by:
checkRunOnceDone in class AbstractRedmineMojo

init

protected void init()
             throws Exception
Overrides:
init in class AbstractRedmineMojo
Throws:
Exception

doAction

protected void doAction()
                 throws Exception
Description copied from class: AbstractRedmineMojo
Re-expose the protected method for test purposes...

Specified by:
doAction in class AbstractRedmineMojo
Throws:
Exception - if any problems

getAttachmentLinkTemplate

public String getAttachmentLinkTemplate()
Specified by:
getAttachmentLinkTemplate in interface AnnouncementGeneratorConfiguration
Returns:
the redmine attachment url template

getUrl

public String getUrl()
Specified by:
getUrl in interface AnnouncementGeneratorConfiguration
Returns:
the redmine url

getArtifactId

public String getArtifactId()
Specified by:
getArtifactId in interface AnnouncementGeneratorConfiguration

getArtifactUrls

public Map<File,String> getArtifactUrls()
Specified by:
getArtifactUrls in interface AnnouncementGeneratorConfiguration

getAttachmentUrls

public Map<Attachment,String> getAttachmentUrls()
Specified by:
getAttachmentUrls in interface AnnouncementGeneratorConfiguration

getBasedir

public String getBasedir()
Specified by:
getBasedir in interface AnnouncementGeneratorConfiguration

getDeploymentUrl

public String getDeploymentUrl()
Specified by:
getDeploymentUrl in interface AnnouncementGeneratorConfiguration

getDevelopmentTeam

public String getDevelopmentTeam()
Specified by:
getDevelopmentTeam in interface AnnouncementGeneratorConfiguration

getFinalName

public String getFinalName()
Specified by:
getFinalName in interface AnnouncementGeneratorConfiguration

getGroupId

public String getGroupId()
Specified by:
getGroupId in interface AnnouncementGeneratorConfiguration

getIntroduction

public String getIntroduction()
Specified by:
getIntroduction in interface AnnouncementGeneratorConfiguration

getPackaging

public String getPackaging()
Specified by:
getPackaging in interface AnnouncementGeneratorConfiguration

getProjectUrl

public String getProjectUrl()
Specified by:
getProjectUrl in interface AnnouncementGeneratorConfiguration

getUrlDownload

public String getUrlDownload()
Specified by:
getUrlDownload in interface AnnouncementGeneratorConfiguration

getAnnounceParameters

public Map<String,Object> getAnnounceParameters()
Specified by:
getAnnounceParameters in interface AnnouncementGeneratorConfiguration


Copyright © 2009-2011 CodeLutin. All Rights Reserved.