Package org.apache.maven.plugins.release
Class AbstractReleaseMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.release.AbstractReleaseMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractScmReleaseMojo
,CleanReleaseMojo
,PerformReleaseMojo
,UpdateVersionsMojo
public abstract class AbstractReleaseMojo extends org.apache.maven.plugin.AbstractMojo
Base class with shared configuration.- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
arguments
Additional arguments to pass to the Maven executions, separated by spaces.private java.io.File
basedir
private java.io.File
javaHome
TheJAVA_HOME
parameter to use for forked Maven invocations.private java.io.File
localRepoDirectory
The command-line local repository directory in use for this build (if specified).private java.lang.String
mavenExecutorId
Role hint of theMavenExecutor
implementation to use.private java.io.File
mavenHome
TheM2_HOME
parameter to use for forked Maven invocations.private java.lang.String
pomFileName
The file name of the POM to execute any goals against.protected org.apache.maven.project.MavenProject
project
private java.util.List<org.apache.maven.project.MavenProject>
reactorProjects
protected ReleaseManager
releaseManager
private java.lang.String
releaseStrategyId
The role-hint for theStrategy
implementation used to specify the phases per goal.protected org.apache.maven.execution.MavenSession
session
private org.apache.maven.settings.Settings
settings
-
Constructor Summary
Constructors Constructor Description AbstractReleaseMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addArgument(java.lang.String argument)
Add additional arguments.protected ReleaseDescriptorBuilder
createReleaseDescriptor()
Creates the release descriptor from the various goal parameters.protected java.lang.String
getAdditionalProfiles()
Gets the comma separated list of additional profiles for the release build.protected java.io.File
getBasedir()
(package private) static java.nio.file.Path
getCommonBasedir(java.util.List<org.apache.maven.project.MavenProject> reactorProjects)
java.util.List<org.apache.maven.project.MavenProject>
getReactorProjects()
Gets the list of projects in the build reactor.protected ReleaseEnvironment
getReleaseEnvironment()
Gets the environment settings configured for this release.(package private) org.apache.maven.settings.Settings
getSettings()
Gets the effective settings for this build.void
setBasedir(java.io.File basedir)
Sets the base directory of the build.void
setPomFileName(java.lang.String pomFileName)
(package private) void
setReleaseManager(ReleaseManager releaseManager)
Sets the component used to perform release actions.-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
basedir
@Parameter(defaultValue="${basedir}", readonly=true, required=true) private java.io.File basedir
-
settings
@Parameter(defaultValue="${settings}", readonly=true, required=true) private org.apache.maven.settings.Settings settings
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
-
releaseManager
@Component protected ReleaseManager releaseManager
-
arguments
@Parameter(alias="prepareVerifyArgs", property="arguments") private java.lang.String arguments
Additional arguments to pass to the Maven executions, separated by spaces.
-
pomFileName
@Parameter(property="pomFileName", defaultValue="${project.file.name}") private java.lang.String pomFileName
The file name of the POM to execute any goals against. As of version 3.0.0, this defaults to the name of POM file of the project being built.
-
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true, required=true) private java.util.List<org.apache.maven.project.MavenProject> reactorProjects
-
mavenHome
@Parameter(defaultValue="${maven.home}") private java.io.File mavenHome
TheM2_HOME
parameter to use for forked Maven invocations.- Since:
- 2.0-beta-8
-
javaHome
@Parameter(defaultValue="${java.home}") private java.io.File javaHome
TheJAVA_HOME
parameter to use for forked Maven invocations.- Since:
- 2.0-beta-8
-
localRepoDirectory
@Parameter(defaultValue="${maven.repo.local}") private java.io.File localRepoDirectory
The command-line local repository directory in use for this build (if specified).- Since:
- 2.0-beta-8
-
mavenExecutorId
@Parameter(defaultValue="invoker", property="mavenExecutorId") private java.lang.String mavenExecutorId
Role hint of theMavenExecutor
implementation to use.- Since:
- 2.0-beta-8
-
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession session
- Since:
- 2.0
-
releaseStrategyId
@Parameter(defaultValue="default", property="releaseStrategyId") private java.lang.String releaseStrategyId
The role-hint for theStrategy
implementation used to specify the phases per goal.- Since:
- 3.0.0
- See Also:
DefaultStrategy
-
-
Method Detail
-
getReleaseEnvironment
protected ReleaseEnvironment getReleaseEnvironment()
Gets the environment settings configured for this release.- Returns:
- The release environment, never
null
.
-
createReleaseDescriptor
protected ReleaseDescriptorBuilder createReleaseDescriptor()
Creates the release descriptor from the various goal parameters.- Returns:
- The release descriptor, never
null
.
-
getAdditionalProfiles
protected java.lang.String getAdditionalProfiles()
Gets the comma separated list of additional profiles for the release build.- Returns:
- additional profiles to enable during release
-
setReleaseManager
void setReleaseManager(ReleaseManager releaseManager)
Sets the component used to perform release actions.- Parameters:
releaseManager
- The release manager implementation to use, must not benull
.
-
getSettings
org.apache.maven.settings.Settings getSettings()
Gets the effective settings for this build.- Returns:
- The effective settings for this build, never
null
.
-
getBasedir
protected final java.io.File getBasedir()
-
setBasedir
public void setBasedir(java.io.File basedir)
Sets the base directory of the build.- Parameters:
basedir
- The build's base directory, must not benull
.
-
setPomFileName
public void setPomFileName(java.lang.String pomFileName)
-
getReactorProjects
public java.util.List<org.apache.maven.project.MavenProject> getReactorProjects()
Gets the list of projects in the build reactor.- Returns:
- The list of reactor project, never
null
.
-
addArgument
protected void addArgument(java.lang.String argument)
Add additional arguments.- Parameters:
argument
- The argument to add, must not benull
.
-
getCommonBasedir
static java.nio.file.Path getCommonBasedir(java.util.List<org.apache.maven.project.MavenProject> reactorProjects) throws java.io.IOException
- Throws:
java.io.IOException
-
-