org.apache.maven.plugins.release
Class AbstractReleaseMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugins.release.AbstractReleaseMojo
All Implemented Interfaces:
ContextEnabled, Mojo
Direct Known Subclasses:
BranchReleaseMojo, CleanReleaseMojo, PerformReleaseMojo, PrepareReleaseMojo, RollbackReleaseMojo, StageReleaseMojo, UpdateVersionsMojo

public abstract class AbstractReleaseMojo
extends AbstractMojo

Base class with shared configuration.

Version:
$Id: AbstractReleaseMojo.java 1333174 2012-05-02 19:52:18Z rfscholte $
Author:
Brett Porter

Field Summary
protected  File mavenHome
          The M2_HOME parameter to use for forked Maven invocations.
protected  MavenProject project
           
protected  ReleaseManager releaseManager
           
protected  MavenSession session
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractReleaseMojo()
           
 
Method Summary
protected  void addArgument(String argument)
          Add additional arguments.
protected  ReleaseDescriptor createReleaseDescriptor()
          Creates the release descriptor from the various goal parameters.
 void execute()
          
protected  String getAdditionalProfiles()
          Gets the comma separated list of additional profiles for the release build.
protected  File getBasedir()
           
 List<MavenProject> getReactorProjects()
          Gets the list of projects in the build reactor.
protected  ReleaseEnvironment getReleaseEnvironment()
          Gets the enviroment settings configured for this release.
protected  void mergeCommandLineConfig(ReleaseDescriptor config, ReleaseDescriptor sysPropertiesConfig)
          This method takes some of the release configuration picked up from the command line system properties and copies it into the release config object.
 void setBasedir(File basedir)
          Sets the base directory of the build.
 
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
 

Field Detail

project

protected MavenProject project
Is defined by:
default-value:
${project}
Is readonly.
Is required.

releaseManager

protected ReleaseManager releaseManager
Is a Plexus component defined by:

mavenHome

protected File mavenHome
The M2_HOME parameter to use for forked Maven invocations.

Since:
2.0-beta-8
Is defined by:
default-value:
${maven.home}

session

protected MavenSession session
Since:
2.0
Is defined by:
default-value:
${session}
Is readonly.
Is required.
Constructor Detail

AbstractReleaseMojo

public AbstractReleaseMojo()
Method Detail

getReleaseEnvironment

protected ReleaseEnvironment getReleaseEnvironment()
Gets the enviroment settings configured for this release.

Returns:
The release environment, never null.

execute

public void execute()
             throws MojoExecutionException,
                    MojoFailureException

Throws:
MojoExecutionException
MojoFailureException

createReleaseDescriptor

protected ReleaseDescriptor createReleaseDescriptor()
Creates the release descriptor from the various goal parameters.

Returns:
The release descriptor, never null.

getAdditionalProfiles

protected String getAdditionalProfiles()
Gets the comma separated list of additional profiles for the release build.

Returns:
additional profiles to enable during release

getBasedir

protected final File getBasedir()

setBasedir

public void setBasedir(File basedir)
Sets the base directory of the build.

Parameters:
basedir - The build's base directory, must not be null.

getReactorProjects

public List<MavenProject> getReactorProjects()
Gets the list of projects in the build reactor.

Returns:
The list of reactor project, never null.

addArgument

protected void addArgument(String argument)
Add additional arguments.

Parameters:
argument - The argument to add, must not be null.

mergeCommandLineConfig

protected void mergeCommandLineConfig(ReleaseDescriptor config,
                                      ReleaseDescriptor sysPropertiesConfig)
This method takes some of the release configuration picked up from the command line system properties and copies it into the release config object.

Parameters:
config - The release configuration to merge the system properties into, must not be null.
sysPropertiesConfig - The configuration from the system properties to merge in, must not be null.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.