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, org.nuiton.plugin.Plugin
Direct Known Subclasses:
GenerateEmailAnnouncementMojo, GenerateNewsAnnouncementMojo

public abstract class AbstractAnnouncementMojo
extends AbstractRedmineMojo

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.lang.String basedir
          The current project base directory.
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  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  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()
           
 org.apache.velocity.context.Context createVelocityContext(AnnouncementGenerator generator, java.util.List<?> releases)
           
protected  void doAction()
          Re-expose the protected method for test purposes...
protected abstract  java.lang.String getAnnouncementTemplate()
           
protected  void init()
           
protected  boolean isRunOnce()
           
 
Methods inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
afterExecute, checkSkip, closeService, getEncoding, getProject, getRestPassword, getRestUrl, getRestUsername, 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.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:

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

velocity

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

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

AbstractAnnouncementMojo

protected AbstractAnnouncementMojo()
Method Detail

getAnnouncementTemplate

protected abstract java.lang.String getAnnouncementTemplate()

isRunOnce

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

checkRunOnceDone

protected boolean checkRunOnceDone()
Specified by:
checkRunOnceDone in class AbstractRedmineMojo
Returns:
true if the goal was already invoked

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()

createVelocityContext

public org.apache.velocity.context.Context createVelocityContext(AnnouncementGenerator generator,
                                                                 java.util.List<?> releases)
                                                          throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2009-2010 CodeLutin. All Rights Reserved.