org.apache.maven.shared.release.phase
Class AbstractRewritePomsPhase

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.shared.release.phase.AbstractReleasePhase
          extended by org.apache.maven.shared.release.phase.AbstractRewritePomsPhase
All Implemented Interfaces:
ReleasePhase, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
RewritePomsForBranchPhase, RewritePomsForDevelopmentPhase, RewritePomsForReleasePhase, RewritePomVersionsPhase

public abstract class AbstractRewritePomsPhase
extends AbstractReleasePhase

Base class for rewriting phases.

Author:
Brett Porter

Field Summary
 
Fields inherited from interface org.apache.maven.shared.release.phase.ReleasePhase
ROLE
 
Constructor Summary
AbstractRewritePomsPhase()
           
 
Method Summary
protected  Scm buildScm(MavenProject project)
           
 ReleaseResult clean(List<MavenProject> reactorProjects)
          Clean up after a phase if it leaves any additional files in the checkout.
 ReleaseResult execute(ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment, List<MavenProject> reactorProjects)
          Execute the phase.
protected abstract  Map<String,String> getNextVersionMap(ReleaseDescriptor releaseDescriptor)
           
protected  String getOriginalResolvedSnapshotVersion(String artifactVersionlessKey, Map<String,Map<String,String>> resolvedSnapshots)
           
protected abstract  Map<String,String> getOriginalVersionMap(ReleaseDescriptor releaseDescriptor, List<MavenProject> reactorProjects, boolean simulate)
           
protected abstract  String getResolvedSnapshotVersion(String artifactVersionlessKey, Map<String,Map<String,String>> resolvedSnapshots)
           
protected  org.jdom.Element rewriteElement(String name, String value, org.jdom.Element root, org.jdom.Namespace namespace)
           
 void setLs(String ls)
           
 ReleaseResult simulate(ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment, List<MavenProject> reactorProjects)
          Simulate the phase, but don't make any changes to the project.
protected abstract  void transformScm(MavenProject project, org.jdom.Element rootElement, org.jdom.Namespace namespace, ReleaseDescriptor releaseDescriptor, String projectId, ScmRepository scmRepository, ReleaseResult result, String commonBasedir)
           
 
Methods inherited from class org.apache.maven.shared.release.phase.AbstractReleasePhase
execute, getReleaseResultSuccess, logDebug, logDebug, logError, logInfo, logWarn, simulate
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRewritePomsPhase

public AbstractRewritePomsPhase()
Method Detail

setLs

public void setLs(String ls)

execute

public ReleaseResult execute(ReleaseDescriptor releaseDescriptor,
                             ReleaseEnvironment releaseEnvironment,
                             List<MavenProject> reactorProjects)
                      throws ReleaseExecutionException,
                             ReleaseFailureException
Description copied from interface: ReleasePhase
Execute the phase.

Parameters:
releaseDescriptor - the configuration to use
releaseEnvironment - the environmental configuration, such as Maven settings, Maven home, etc.
reactorProjects - the reactor projects
Returns:
the release result
Throws:
ReleaseExecutionException - an exception during the execution of the phase
ReleaseFailureException - a failure during the execution of the phase

simulate

public ReleaseResult simulate(ReleaseDescriptor releaseDescriptor,
                              ReleaseEnvironment releaseEnvironment,
                              List<MavenProject> reactorProjects)
                       throws ReleaseExecutionException,
                              ReleaseFailureException
Description copied from interface: ReleasePhase
Simulate the phase, but don't make any changes to the project.

Parameters:
releaseDescriptor - the configuration to use
releaseEnvironment - the environmental configuration, such as Maven settings, Maven home, etc.
reactorProjects - the reactor projects
Returns:
the release result
Throws:
ReleaseExecutionException - an exception during the execution of the phase
ReleaseFailureException - a failure during the execution of the phase

clean

public ReleaseResult clean(List<MavenProject> reactorProjects)
Description copied from interface: ReleasePhase
Clean up after a phase if it leaves any additional files in the checkout.

Specified by:
clean in interface ReleasePhase
Overrides:
clean in class AbstractReleasePhase
Parameters:
reactorProjects - the reactor projects
Returns:
the release result

getResolvedSnapshotVersion

protected abstract String getResolvedSnapshotVersion(String artifactVersionlessKey,
                                                     Map<String,Map<String,String>> resolvedSnapshots)

getOriginalVersionMap

protected abstract Map<String,String> getOriginalVersionMap(ReleaseDescriptor releaseDescriptor,
                                                            List<MavenProject> reactorProjects,
                                                            boolean simulate)

getNextVersionMap

protected abstract Map<String,String> getNextVersionMap(ReleaseDescriptor releaseDescriptor)

transformScm

protected abstract void transformScm(MavenProject project,
                                     org.jdom.Element rootElement,
                                     org.jdom.Namespace namespace,
                                     ReleaseDescriptor releaseDescriptor,
                                     String projectId,
                                     ScmRepository scmRepository,
                                     ReleaseResult result,
                                     String commonBasedir)
                              throws ReleaseExecutionException
Throws:
ReleaseExecutionException

getOriginalResolvedSnapshotVersion

protected String getOriginalResolvedSnapshotVersion(String artifactVersionlessKey,
                                                    Map<String,Map<String,String>> resolvedSnapshots)

rewriteElement

protected org.jdom.Element rewriteElement(String name,
                                          String value,
                                          org.jdom.Element root,
                                          org.jdom.Namespace namespace)

buildScm

protected Scm buildScm(MavenProject project)


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