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.InitState, org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected  String actionMapping
          The action mapping to the redmine tracker ids.
protected  boolean anonymous
          Flag to know if anonymùous connexion to redmine server is required.
protected  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  String changesTitle
          The changes file title.
protected  Map<String,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  String releaseDescription
          The description of the release.
protected  boolean skipGenerateChanges
          A flag to skip the goal.
protected  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  Map<Integer,String> trackerToAction
          le mapping entre l'id d'un tracker et le type d'action
protected  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, 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
GenerateChangesMojo()
           
 
Method Summary
protected  org.apache.maven.plugins.changes.model.ChangesDocument buildChangesDocument(Version version, User user, IssuesCollector collector)
           
protected  boolean checkRunOnceDone()
           
protected  boolean checkSkip()
           
protected  void doAction()
          Re-expose the protected method for test purposes...
 String getCategoryIds()
           
protected  Map<String,String> getFilters()
           
 int getMaxEntries()
           
 String getPriorityIds()
           
 String getProjectId()
           
 String getStatusIds()
           
 String getTrackerIds()
           
 String getVersionId()
           
 String getVersionNames()
           
protected  void init()
           
 boolean isAnonymous()
           
protected  boolean isGoalSkip()
           
 boolean isOnlyCurrentVersion()
           
protected  boolean isRunOnce()
           
 void setAnonymous(boolean anonymous)
           
 void setVersionId(String versionId)
           
 
Methods inherited from class org.nuiton.jredmine.plugin.AbstractRedmineMojo
afterExecute, closeService, 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, 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.IssueCollectorConfiguration
isVerbose
 
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

xmlPath

protected 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 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 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 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 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 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 Map<Integer,String> trackerToAction
le mapping entre l'id d'un tracker et le type d'action


filters

protected Map<String,String> filters
Constructor Detail

GenerateChangesMojo

public GenerateChangesMojo()
Method Detail

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

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 void init()
             throws Exception
Overrides:
init in class AbstractRedmineMojo
Throws:
Exception

checkSkip

protected boolean checkSkip()
Overrides:
checkSkip in class AbstractRedmineMojo

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

buildChangesDocument

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

getProjectId

public String getProjectId()
Specified by:
getProjectId in interface IssueCollectorConfiguration
Overrides:
getProjectId in class AbstractRedmineMojo

getVersionId

public String getVersionId()
Specified by:
getVersionId in interface IssueCollectorConfiguration
Overrides:
getVersionId in class AbstractRedmineMojo

isOnlyCurrentVersion

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

getMaxEntries

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

getPriorityIds

public String getPriorityIds()
Specified by:
getPriorityIds in interface IssueCollectorConfiguration

setVersionId

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

getCategoryIds

public String getCategoryIds()
Specified by:
getCategoryIds in interface IssueCollectorConfiguration

getVersionNames

public String getVersionNames()
Specified by:
getVersionNames in interface IssueCollectorConfiguration

getStatusIds

public String getStatusIds()
Specified by:
getStatusIds in interface IssueCollectorConfiguration

getTrackerIds

public String getTrackerIds()
Specified by:
getTrackerIds in interface IssueCollectorConfiguration

getFilters

protected Map<String,String> getFilters()


Copyright © 2009-2010 CodeLutin. All Rights Reserved.