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  java.util.Map<java.lang.String,java.lang.Object> announceParameters
          Map which will be pass to the velocity context
protected  java.lang.String artifactId
           
protected  java.io.File artifactsFile
           
protected  java.util.Map<java.io.File,java.lang.String> artifactUrls
           
protected  java.lang.String attachmentLinkTemplate
          Template strings per system that is used to discover the URL to use to display an attchment.
protected  Attachment[] attachments
           
protected  java.util.Map<Attachment,java.lang.String> attachmentUrls
           
protected  java.lang.String basedir
          The current project base directory.
protected  java.lang.String deploymentUrl
           
protected  java.lang.String developmentTeam
          Name of the team that develops the artifact.
protected  java.lang.String finalName
          The name of the artifact to be used in the announcement.
protected  AnnouncementGenerator generator
           
protected  java.lang.String groupId
           
protected  java.lang.String introduction
          Short description or introduction of the released artifact.
protected  java.lang.String packaging
          Packaging structure for the artifact.
protected  java.lang.String projectUrl
          Distribution url of the artifact.
protected  java.util.List<?> releases
           
protected  boolean runOnce
          A flag to restirct only one run in a build (for multi-module context).
protected  java.lang.String templateDirectory
          Directory that contains the template.
protected  java.lang.String templateEncoding
          The template encoding.
protected  java.io.File templateOutputDirectory
          Directory where the template file will be generated.
protected  java.lang.String urlDownload
          URL where the artifact can be downloaded.
protected  org.codehaus.plexus.velocity.VelocityComponent velocity
          Velocity Component.
protected  java.io.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  java.lang.String getAnnouncementTemplate()
           
 java.util.Map<java.lang.String,java.lang.Object> getAnnounceParameters()
           
 java.lang.String getArtifactId()
           
 java.util.Map<java.io.File,java.lang.String> getArtifactUrls()
           
 java.lang.String getAttachmentLinkTemplate()
           
 java.util.Map<Attachment,java.lang.String> getAttachmentUrls()
           
 java.lang.String getBasedir()
           
 java.lang.String getDeploymentUrl()
           
 java.lang.String getDevelopmentTeam()
           
 java.lang.String getFinalName()
           
 java.lang.String getGroupId()
           
 java.lang.String getIntroduction()
           
 java.lang.String getPackaging()
           
 java.lang.String getProjectUrl()
           
 java.lang.String getUrl()
           
 java.lang.String getUrlDownload()
           
protected  void init()
           
protected  boolean isRunOnce()
           
 
Methods inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
afterExecute, checkSkip, closeService, getEncoding, getProject, getProjectId, getRestPassword, getRestUrl, getRestUsername, getVersionId, initReleaseProject, initReleaseUser, initReleaseVersion, isAnonymous, isGoalSkip, isRunOnceDone, isSafe, isVerbose, setAnonymous, setEncoding, setProject, setRestPassword, setRestUrl, setRestUsername, setSafe, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addTestResourceDir, addUrlToUrlsList, backupFile, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, 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

templateOutputDirectory

protected java.io.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 java.io.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 java.lang.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 java.lang.String templateEncoding
The template encoding.

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

announceParameters

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

Since:
1.0.0
Is defined by:

attachmentLinkTemplate

protected java.lang.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 java.lang.String groupId
Since:
1.0.0
Is defined by:
expression:
${project.groupId}
Is readonly.

artifactId

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

projectUrl

protected java.lang.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 java.lang.String packaging
Packaging structure for the artifact.

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

finalName

protected java.lang.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 java.lang.String basedir
The current project base directory.

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

urlDownload

protected java.lang.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 java.lang.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 java.lang.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 java.io.File artifactsFile
Since:
1.2.1
Is defined by:
expression:
${redmine.artifactsFile}

deploymentUrl

protected java.lang.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 java.util.Map<java.io.File,java.lang.String> artifactUrls

attachmentUrls

protected java.util.Map<Attachment,java.lang.String> attachmentUrls

releases

protected java.util.List<?> releases

generator

protected AnnouncementGenerator generator
Constructor Detail

AbstractAnnouncementMojo

protected AbstractAnnouncementMojo()
Method Detail

getAnnouncementTemplate

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

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 java.lang.Exception
Overrides:
init in class AbstractRedmineMojo
Throws:
java.lang.Exception

doAction

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

Specified by:
doAction in class AbstractRedmineMojo
Throws:
java.lang.Exception
See Also:
AbstractPlugin.doAction()

getAttachmentLinkTemplate

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

getUrl

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

getArtifactId

public java.lang.String getArtifactId()
Specified by:
getArtifactId in interface AnnouncementGeneratorConfiguration

getArtifactUrls

public java.util.Map<java.io.File,java.lang.String> getArtifactUrls()
Specified by:
getArtifactUrls in interface AnnouncementGeneratorConfiguration

getAttachmentUrls

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

getBasedir

public java.lang.String getBasedir()
Specified by:
getBasedir in interface AnnouncementGeneratorConfiguration

getDeploymentUrl

public java.lang.String getDeploymentUrl()
Specified by:
getDeploymentUrl in interface AnnouncementGeneratorConfiguration

getDevelopmentTeam

public java.lang.String getDevelopmentTeam()
Specified by:
getDevelopmentTeam in interface AnnouncementGeneratorConfiguration

getFinalName

public java.lang.String getFinalName()
Specified by:
getFinalName in interface AnnouncementGeneratorConfiguration

getGroupId

public java.lang.String getGroupId()
Specified by:
getGroupId in interface AnnouncementGeneratorConfiguration

getIntroduction

public java.lang.String getIntroduction()
Specified by:
getIntroduction in interface AnnouncementGeneratorConfiguration

getPackaging

public java.lang.String getPackaging()
Specified by:
getPackaging in interface AnnouncementGeneratorConfiguration

getProjectUrl

public java.lang.String getProjectUrl()
Specified by:
getProjectUrl in interface AnnouncementGeneratorConfiguration

getUrlDownload

public java.lang.String getUrlDownload()
Specified by:
getUrlDownload in interface AnnouncementGeneratorConfiguration

getAnnounceParameters

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


Copyright © 2009-2010 CodeLutin. All Rights Reserved.