org.nuiton.jredmine.plugin
Class GenerateChangesMojo

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.GenerateChangesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.io.rest.RestClientConfiguration, IssueCollectorConfiguration, org.nuiton.plugin.Plugin

public class GenerateChangesMojo
extends AbstractRedmineMojo
implements IssueCollectorConfiguration

Generates the changes.xml file from the Redmine's server to be used by the maven-changes-plugin to generates the release report and send the annoncement mail at a release time.

Since:
1.0.0
Author:
tchemit
Is defined by the goal name:
generate-changes

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected  java.lang.String actionMapping
          The action mapping to the redmine tracker ids.
protected  java.lang.String categoryIds
          The comma separated list of category ids to include in the changes.xml Note : If a value is set to empty - that means to include all categories.
protected  java.lang.String changesTitle
          The changes file title.
protected  java.util.Map<java.lang.String,java.lang.String> filters
           
protected  boolean generateOnce
          A flag to generate only once in a multi-module project.
protected  boolean onlyCurrentVersion
          If you only want to show issues for the current version in the report.
protected  java.lang.String releaseDescription
          The description of the release.
protected  boolean skipGenerateChanges
          A flag to skip the goal.
protected  java.lang.String statusIds
          The comma separated list of statuses ids to include in the changes.xml Note : If a value is set to empty - that means to include all status.
protected  java.util.Map<java.lang.Integer,java.lang.String> trackerToAction
          le mapping entre l'id d'un tracker et le type d'action
protected  java.io.File xmlPath
          The path of the changes.xml file that will be converted into an HTML report.
 
Fields inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
dateFormat, encoding, password, project, projectId, REDMINE_SYSTEM, releaseProject, releaseUser, releaseVersion, runOnceDone, safe, service, session, url, username, users, verbose, versionId
 
Fields inherited from class org.nuiton.plugin.AbstractPlugin
skipAfterInitMessage
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
GenerateChangesMojo()
           
 
Method Summary
protected  org.apache.maven.plugins.changes.model.ChangesDocument buildChangesDocument(Project project, Version version, User user, IssuesCollector collector)
           
protected  boolean checkRunOnceDone()
           
protected  void doAction()
          Re-expose the protected method for test purposes...
 java.lang.String getCategoryIds()
           
protected  java.util.Map<java.lang.String,java.lang.String> getFilters()
           
 int getMaxEntries()
           
 java.lang.String getPriorityIds()
           
 java.lang.String getProjectId()
           
 java.lang.String getStatusIds()
           
 java.lang.String getTrackerIds()
           
 java.lang.String getVersionId()
           
 java.lang.String getVersionNames()
           
protected  boolean init()
           
protected  boolean isGoalSkip()
           
 boolean isOnlyCurrentVersion()
           
protected  boolean isRunOnce()
           
 void setVersionId(java.lang.String versionId)
           
 
Methods inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
closeService, execute, getEncoding, getProject, getRestPassword, getRestUrl, getRestUsername, initReleaseProject, initReleaseUser, initReleaseVersion, 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, checkPackaging, checkResource, checkRunOnceDone, copyFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, 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.IssueCollectorConfiguration
isVerbose
 
Methods inherited from interface org.apache.maven.plugin.Mojo
getLog, setLog
 

Field Detail

xmlPath

protected java.io.File xmlPath
The path of the changes.xml file that will be converted into an HTML report.

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

releaseDescription

protected java.lang.String releaseDescription
The description of the release. Note : if not sets - will use the redmine version description (if exists).

Since:
1.0.0
Is defined by:
expression:
${releaseDescription}

changesTitle

protected java.lang.String changesTitle
The changes file title.

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

onlyCurrentVersion

protected boolean onlyCurrentVersion
If you only want to show issues for the current version in the report. The current version being used is ${project.version} minus any "-SNAPSHOT" suffix.

Since:
1.0.0
Is defined by:
expression:
${redmine.onlyCurrentVersion}
default-value:
false

actionMapping

protected java.lang.String actionMapping
The action mapping to the redmine tracker ids. Possible actions are add, fix, update, remove The syntax of mapping is action:id [,action:id]* Example :
  fix:1
  fix:1, add:1
 

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

statusIds

protected java.lang.String statusIds
The comma separated list of statuses ids to include in the changes.xml Note : If a value is set to empty - that means to include all status.

Since:
1.0.0
Is defined by:
expression:
${redmine.statusIds}

categoryIds

protected java.lang.String categoryIds
The comma separated list of category ids to include in the changes.xml Note : If a value is set to empty - that means to include all categories.

Since:
1.0.0
Is defined by:
expression:
${redmine.categoryIds}

skipGenerateChanges

protected boolean skipGenerateChanges
A flag to skip the goal.

Since:
1.0.0
Is defined by:
expression:
${redmine.skipGenerateChanges}
default-value:
false

generateOnce

protected boolean generateOnce
A flag to generate only once in a multi-module project. The changes.xml file will be generated only once in the pom module and then copy in the modules.

The default behaviour is to generate once to reduce calls to redmine

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

trackerToAction

protected java.util.Map<java.lang.Integer,java.lang.String> trackerToAction
le mapping entre l'id d'un tracker et le type d'action


filters

protected java.util.Map<java.lang.String,java.lang.String> filters
Constructor Detail

GenerateChangesMojo

public GenerateChangesMojo()
Method Detail

isGoalSkip

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

isRunOnce

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

checkRunOnceDone

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

init

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

buildChangesDocument

protected org.apache.maven.plugins.changes.model.ChangesDocument buildChangesDocument(Project project,
                                                                                      Version version,
                                                                                      User user,
                                                                                      IssuesCollector collector)
                                                                               throws RedmineServiceException
Throws:
RedmineServiceException

getProjectId

public java.lang.String getProjectId()
Specified by:
getProjectId in interface IssueCollectorConfiguration

getVersionId

public java.lang.String getVersionId()
Specified by:
getVersionId in interface IssueCollectorConfiguration

isOnlyCurrentVersion

public boolean isOnlyCurrentVersion()
Specified by:
isOnlyCurrentVersion in interface IssueCollectorConfiguration

getMaxEntries

public int getMaxEntries()
Specified by:
getMaxEntries in interface IssueCollectorConfiguration

getPriorityIds

public java.lang.String getPriorityIds()
Specified by:
getPriorityIds in interface IssueCollectorConfiguration

setVersionId

public void setVersionId(java.lang.String versionId)
Specified by:
setVersionId in interface IssueCollectorConfiguration

getCategoryIds

public java.lang.String getCategoryIds()
Specified by:
getCategoryIds in interface IssueCollectorConfiguration

getVersionNames

public java.lang.String getVersionNames()
Specified by:
getVersionNames in interface IssueCollectorConfiguration

getStatusIds

public java.lang.String getStatusIds()
Specified by:
getStatusIds in interface IssueCollectorConfiguration

getTrackerIds

public java.lang.String getTrackerIds()
Specified by:
getTrackerIds in interface IssueCollectorConfiguration

getFilters

protected java.util.Map<java.lang.String,java.lang.String> getFilters()


Copyright © 2009 CodeLutin. All Rights Reserved.