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 ReleaseDescriptorStoreconfigStoreThe configuration storage.private static intERRORprivate static intGOAL_ENDprivate static intPHASE_ENDprivate static intPHASE_SKIPprivate static intPHASE_STARTprivate java.util.Map<java.lang.String,ReleasePhase>releasePhasesThe 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 voidbranch(ReleaseBranchRequest branchRequest)Branch a projectprivate voidcaptureException(ReleaseResult result, ReleaseManagerListener listener, java.lang.Exception e)protected voidclean(AbstractReleaseRequest releaseRequest)voidclean(ReleaseCleanRequest cleanRequest)Clean a release.protected java.io.FiledetermineWorkingDirectory(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 StrategygetStrategy(java.lang.String strategyId)(package private) voidgoalStart(ReleaseManagerListener listener, java.lang.String goal, java.util.List<java.lang.String> phases)private ReleaseDescriptorBuilder.BuilderReleaseDescriptorloadReleaseDescriptor(ReleaseDescriptorBuilder builder, ReleaseManagerListener listener)private voidlogInfo(ReleaseResult result, java.lang.String message)voidperform(ReleasePerformRequest performRequest)Perform a releaseprivate voidperform(ReleasePerformRequest performRequest, ReleaseResult result)ReleaseResultperformWithResult(ReleasePerformRequest performRequest)voidprepare(ReleasePrepareRequest prepareRequest)Prepare a release.private voidprepare(ReleasePrepareRequest prepareRequest, ReleaseResult result)ReleaseResultprepareWithResult(ReleasePrepareRequest prepareRequest)voidrollback(ReleaseRollbackRequest rollbackRequest)Rollback changes made by the previous release(package private) voidsetConfigStore(ReleaseDescriptorStore configStore)(package private) voidupdateListener(ReleaseManagerListener listener, java.lang.String name, int state)voidupdateVersions(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:
prepareWithResultin interfaceReleaseManager
-
prepare
public void prepare(ReleasePrepareRequest prepareRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManagerPrepare a release.- Specified by:
preparein 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:ReleaseManagerRollback changes made by the previous release- Specified by:
rollbackin 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:
performWithResultin interfaceReleaseManager
-
perform
public void perform(ReleasePerformRequest performRequest) throws ReleaseExecutionException, ReleaseFailureException
Description copied from interface:ReleaseManagerPerform a release- Specified by:
performin 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:ReleaseManagerBranch a project- Specified by:
branchin 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:ReleaseManagerUpdate version numbers for a project- Specified by:
updateVersionsin 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:ReleaseManagerClean a release.- Specified by:
cleanin 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)
-
-