Package org.apache.maven.shared.release
Class DefaultReleaseManager
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.apache.maven.shared.release.DefaultReleaseManager
-
- All Implemented Interfaces:
ReleaseManager
,org.codehaus.plexus.logging.LogEnabled
@Component(role=ReleaseManager.class) public class DefaultReleaseManager extends org.codehaus.plexus.logging.AbstractLogEnabled implements ReleaseManager
Implementation of the release manager.
-
-
Field Summary
Fields Modifier and Type Field Description private ReleaseDescriptorStore
configStore
The configuration storage.private static int
ERROR
private static int
GOAL_END
private static int
PHASE_END
private static int
PHASE_SKIP
private static int
PHASE_START
private java.util.Map<java.lang.String,ReleasePhase>
releasePhases
The available phases.private java.util.Map<java.lang.String,Strategy>
strategies
-
Constructor Summary
Constructors Constructor Description DefaultReleaseManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
branch(ReleaseBranchRequest branchRequest)
Branch a projectprivate void
captureException(ReleaseResult result, ReleaseManagerListener listener, java.lang.Exception e)
protected void
clean(AbstractReleaseRequest releaseRequest)
void
clean(ReleaseCleanRequest cleanRequest)
Clean a release.protected java.io.File
determineWorkingDirectory(java.io.File checkoutDirectory, java.lang.String relativePathProjectDirectory)
Determines the path of the working directory.private java.util.List<java.lang.String>
getGoalPhases(Strategy strategy, java.lang.String goal)
private Strategy
getStrategy(java.lang.String strategyId)
(package private) void
goalStart(ReleaseManagerListener listener, java.lang.String goal, java.util.List<java.lang.String> phases)
private ReleaseDescriptorBuilder.BuilderReleaseDescriptor
loadReleaseDescriptor(ReleaseDescriptorBuilder builder, ReleaseManagerListener listener)
private void
logInfo(ReleaseResult result, java.lang.String message)
void
perform(ReleasePerformRequest performRequest)
Perform a releaseprivate void
perform(ReleasePerformRequest performRequest, ReleaseResult result)
ReleaseResult
performWithResult(ReleasePerformRequest performRequest)
void
prepare(ReleasePrepareRequest prepareRequest)
Prepare a release.private void
prepare(ReleasePrepareRequest prepareRequest, ReleaseResult result)
ReleaseResult
prepareWithResult(ReleasePrepareRequest prepareRequest)
void
rollback(ReleaseRollbackRequest rollbackRequest)
Rollback changes made by the previous release(package private) void
setConfigStore(ReleaseDescriptorStore configStore)
(package private) void
updateListener(ReleaseManagerListener listener, java.lang.String name, int state)
void
updateVersions(ReleaseUpdateVersionsRequest updateVersionsRequest)
Update version numbers for a project
-
-
-
Field Detail
-
strategies
@Requirement private java.util.Map<java.lang.String,Strategy> strategies
-
releasePhases
@Requirement private java.util.Map<java.lang.String,ReleasePhase> releasePhases
The available phases.
-
configStore
@Requirement(hint="properties") private ReleaseDescriptorStore configStore
The configuration storage.
-
PHASE_SKIP
private static final int PHASE_SKIP
- See Also:
- Constant Field Values
-
PHASE_START
private static final int PHASE_START
- See Also:
- Constant Field Values
-
PHASE_END
private static final int PHASE_END
- See Also:
- Constant Field Values
-
GOAL_END
private static final int GOAL_END
- See Also:
- Constant Field Values
-
ERROR
private static final int ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
prepareWithResult
public ReleaseResult prepareWithResult(ReleasePrepareRequest prepareRequest)
- Specified by:
prepareWithResult
in interfaceReleaseManager
-
prepare
public void prepare(ReleasePrepareRequest prepareRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManager
Prepare a release.- Specified by:
prepare
in interfaceReleaseManager
- Parameters:
prepareRequest
- all prepare arguments- Throws:
ReleaseExecutionException
- if there is a problem performing the releaseReleaseFailureException
- if there is a problem performing the release
-
prepare
private void prepare(ReleasePrepareRequest prepareRequest, ReleaseResult result) throws ReleaseExecutionException, ReleaseFailureException
-
rollback
public void rollback(ReleaseRollbackRequest rollbackRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManager
Rollback changes made by the previous release- Specified by:
rollback
in interfaceReleaseManager
- Parameters:
rollbackRequest
- all rollback arguments- Throws:
ReleaseExecutionException
- if there is a problem during release rollbackReleaseFailureException
- if there is a problem during release rollback
-
performWithResult
public ReleaseResult performWithResult(ReleasePerformRequest performRequest)
- Specified by:
performWithResult
in interfaceReleaseManager
-
perform
public void perform(ReleasePerformRequest performRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManager
Perform a release- Specified by:
perform
in interfaceReleaseManager
- Parameters:
performRequest
- all perform arguments- Throws:
ReleaseExecutionException
- if there is a problem performing the releaseReleaseFailureException
- if there is a problem performing the release
-
perform
private void perform(ReleasePerformRequest performRequest, ReleaseResult result) throws ReleaseExecutionException, ReleaseFailureException
-
branch
public void branch(ReleaseBranchRequest branchRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManager
Branch a project- Specified by:
branch
in interfaceReleaseManager
- Parameters:
branchRequest
- all branch arguments- Throws:
ReleaseExecutionException
- if there is a problem during release branchReleaseFailureException
- if there is a problem during release branch
-
updateVersions
public void updateVersions(ReleaseUpdateVersionsRequest updateVersionsRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManager
Update version numbers for a project- Specified by:
updateVersions
in interfaceReleaseManager
- Parameters:
updateVersionsRequest
- all update versions arguments- Throws:
ReleaseExecutionException
- if there is a problem during update versionsReleaseFailureException
- if there is a problem during update versions
-
determineWorkingDirectory
protected java.io.File determineWorkingDirectory(java.io.File checkoutDirectory, java.lang.String relativePathProjectDirectory)
Determines the path of the working directory. By default, this is the checkout directory. For some SCMs, the project root directory is not the checkout directory itself, but a SCM-specific subdirectory.- Parameters:
checkoutDirectory
- The checkout directory as java.io.FilerelativePathProjectDirectory
- The relative path of the project directory within the checkout directory or ""- Returns:
- The working directory
-
loadReleaseDescriptor
private ReleaseDescriptorBuilder.BuilderReleaseDescriptor loadReleaseDescriptor(ReleaseDescriptorBuilder builder, ReleaseManagerListener listener) throws ReleaseExecutionException
- Throws:
ReleaseExecutionException
-
clean
protected void clean(AbstractReleaseRequest releaseRequest) throws ReleaseFailureException
- Throws:
ReleaseFailureException
-
clean
public void clean(ReleaseCleanRequest cleanRequest) throws ReleaseFailureException
Description copied from interface:ReleaseManager
Clean a release.- Specified by:
clean
in interfaceReleaseManager
- Parameters:
cleanRequest
- all clean arguments- Throws:
ReleaseFailureException
-
setConfigStore
void setConfigStore(ReleaseDescriptorStore configStore)
-
goalStart
void goalStart(ReleaseManagerListener listener, java.lang.String goal, java.util.List<java.lang.String> phases)
-
updateListener
void updateListener(ReleaseManagerListener listener, java.lang.String name, int state)
-
getStrategy
private Strategy getStrategy(java.lang.String strategyId) throws ReleaseFailureException
- Throws:
ReleaseFailureException
-
getGoalPhases
private java.util.List<java.lang.String> getGoalPhases(Strategy strategy, java.lang.String goal)
-
logInfo
private void logInfo(ReleaseResult result, java.lang.String message)
-
captureException
private void captureException(ReleaseResult result, ReleaseManagerListener listener, java.lang.Exception e)
-
-