org.nuiton.jredmine.plugin
Class AbstractRedmineMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.jredmine.plugin.AbstractRedmineMojo
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:
AbstractAnnouncementMojo, AbstractRedmineReport, DisplayDataMojo, GenerateChangesMojo, NextVersionMojo, PublishAttachmentsMojo, PublishNewsMojo, UpdateVersionMojo

public abstract class AbstractRedmineMojo
extends org.nuiton.plugin.AbstractPlugin
implements org.nuiton.io.rest.RestClientConfiguration

Abstract redmine mojo.

Since:
1.0.0
Author:
tchemit
Requires to be online to run:
true
Requires a Maven project 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  DateFormat dateFormat
          the date format used to write a date
protected  String encoding
          The encoding used to read and write files.
protected  boolean initOk
           
protected  String password
          The redmine's server password.
protected  org.apache.maven.project.MavenProject project
          Dependance du projet.
protected  String projectId
          Redmine project name.
static String REDMINE_SYSTEM
           
protected  Project releaseProject
          the project loaded in init if requireProject flag is on
protected  User releaseUser
          the user loaded in init if requireUser flag is on
protected  Version releaseVersion
          the version loaded in init if requireVersion flag is on
protected  boolean runOnceDone
          flag to mark if a runOnce goal was done
protected  boolean safe
          Un flag pour faire échouer le build si la configuration n'est pas ok.
protected  RedmineService service
          Redmine service.
protected  boolean serviceInit
          flag to mark if service was sucessfull init
protected  org.apache.maven.execution.MavenSession session
           
protected  URL url
          The real basedir redmine url.
protected  String username
          The redmine's server login.
protected  User[] users
          cache of users of a given project loaded in int if requireUser flag is on
protected  boolean verbose
          Un flag pour activer le mode verbeux.
protected  String versionId
          redmine version name.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractRedmineMojo(boolean requireProject, boolean requireVersion, boolean requireUser)
           
 
Method Summary
protected  void afterExecute()
           
protected abstract  boolean checkRunOnceDone()
           
protected  boolean checkSkip()
           
protected  void closeService()
           
protected abstract  void doAction()
          Re-expose the protected method for test purposes...
 String getEncoding()
           
 org.apache.maven.project.MavenProject getProject()
           
 String getProjectId()
           
 String getRestPassword()
           
 URL getRestUrl()
           
 String getRestUsername()
           
 String getVersionId()
           
protected  void init()
           
protected  boolean initReleaseProject()
           
protected  boolean initReleaseUser()
           
protected  boolean initReleaseVersion()
           
 boolean isAnonymous()
           
protected abstract  boolean isGoalSkip()
           
protected abstract  boolean isRunOnce()
           
 boolean isRunOnceDone()
           
 boolean isSafe()
           
 boolean isVerbose()
           
 void setAnonymous(boolean anonymous)
           
 void setEncoding(String encoding)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setRestPassword(String restPassword)
           
 void setRestUrl(URL restUrl)
           
 void setRestUsername(String restUsername)
           
 void setSafe(boolean safe)
           
 void setVerbose(boolean verbose)
           
 
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

REDMINE_SYSTEM

public static final String REDMINE_SYSTEM
See Also:
Constant Field Values

project

protected org.apache.maven.project.MavenProject project
Dependance du projet.

Since:
1.0.0
Is defined by:
default-value:
${project}
Is readonly.
Is required.

url

protected URL url
The real basedir redmine url.

If no url is given, will use the issue management url.

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

username

protected String username
The redmine's server login.

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

password

protected String password
The redmine's server password.

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

encoding

protected String encoding
The encoding used to read and write files.

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

projectId

protected String projectId
Redmine project name.

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

versionId

protected String versionId
redmine version name.

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

verbose

protected boolean verbose
Un flag pour activer le mode verbeux.

Since:
1.0.0
Is defined by:
expression:
${redmine.verbose}
default-value:
${maven.verbose}

safe

protected boolean safe
Un flag pour faire échouer le build si la configuration n'est pas ok.

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

session

protected org.apache.maven.execution.MavenSession session
Is defined by:
expression:
${session}
Is readonly.

service

protected RedmineService service
Redmine service.

Since:
1.0.0
Is a Plexus component defined by:

releaseProject

protected Project releaseProject
the project loaded in init if requireProject flag is on


releaseVersion

protected Version releaseVersion
the version loaded in init if requireVersion flag is on


releaseUser

protected User releaseUser
the user loaded in init if requireUser flag is on


users

protected User[] users
cache of users of a given project loaded in int if requireUser flag is on


dateFormat

protected DateFormat dateFormat
the date format used to write a date


runOnceDone

protected boolean runOnceDone
flag to mark if a runOnce goal was done


serviceInit

protected boolean serviceInit
flag to mark if service was sucessfull init


initOk

protected boolean initOk
Constructor Detail

AbstractRedmineMojo

public AbstractRedmineMojo(boolean requireProject,
                           boolean requireVersion,
                           boolean requireUser)
Method Detail

init

protected void init()
             throws Exception
Specified by:
init in class org.nuiton.plugin.AbstractPlugin
Throws:
Exception

checkSkip

protected boolean checkSkip()
Overrides:
checkSkip in class org.nuiton.plugin.AbstractPlugin

afterExecute

protected void afterExecute()
Overrides:
afterExecute in class org.nuiton.plugin.AbstractPlugin

doAction

protected abstract void doAction()
                          throws Exception
Re-expose the protected method for test purposes...

Specified by:
doAction in class org.nuiton.plugin.AbstractPlugin
Throws:
Exception
See Also:
AbstractPlugin.doAction()

isGoalSkip

protected abstract boolean isGoalSkip()

isRunOnce

protected abstract boolean isRunOnce()

checkRunOnceDone

protected abstract boolean checkRunOnceDone()

getProject

public org.apache.maven.project.MavenProject getProject()
Specified by:
getProject in interface org.nuiton.plugin.Plugin

setProject

public void setProject(org.apache.maven.project.MavenProject project)
Specified by:
setProject in interface org.nuiton.plugin.Plugin

isVerbose

public boolean isVerbose()
Specified by:
isVerbose in interface org.nuiton.io.rest.RestClientConfiguration
Specified by:
isVerbose in interface org.nuiton.plugin.Plugin

setVerbose

public void setVerbose(boolean verbose)
Specified by:
setVerbose in interface org.nuiton.io.rest.RestClientConfiguration
Specified by:
setVerbose in interface org.nuiton.plugin.Plugin

getRestPassword

public String getRestPassword()
Specified by:
getRestPassword in interface org.nuiton.io.rest.RestClientConfiguration

getRestUrl

public URL getRestUrl()
Specified by:
getRestUrl in interface org.nuiton.io.rest.RestClientConfiguration

getRestUsername

public String getRestUsername()
Specified by:
getRestUsername in interface org.nuiton.io.rest.RestClientConfiguration

setRestPassword

public void setRestPassword(String restPassword)
Specified by:
setRestPassword in interface org.nuiton.io.rest.RestClientConfiguration

setRestUrl

public void setRestUrl(URL restUrl)
Specified by:
setRestUrl in interface org.nuiton.io.rest.RestClientConfiguration

setRestUsername

public void setRestUsername(String restUsername)
Specified by:
setRestUsername in interface org.nuiton.io.rest.RestClientConfiguration

getEncoding

public String getEncoding()
Specified by:
getEncoding in interface org.nuiton.io.rest.RestClientConfiguration

setEncoding

public void setEncoding(String encoding)
Specified by:
setEncoding in interface org.nuiton.io.rest.RestClientConfiguration

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

initReleaseProject

protected boolean initReleaseProject()
                              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

initReleaseVersion

protected boolean initReleaseVersion()
                              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

initReleaseUser

protected boolean initReleaseUser()

closeService

protected void closeService()

isRunOnceDone

public boolean isRunOnceDone()

isSafe

public boolean isSafe()

setSafe

public void setSafe(boolean safe)

getProjectId

public String getProjectId()

getVersionId

public String getVersionId()


Copyright © 2009-2010 CodeLutin. All Rights Reserved.