Class SourceStrategy
java.lang.Object
org.apache.maven.cling.invoker.mvnup.goals.AbstractUpgradeStrategy
org.apache.maven.cling.invoker.mvnup.goals.SourceStrategy
- All Implemented Interfaces:
UpgradeStrategy
Strategy for migrating legacy source configuration to Maven 4.1.0+
<source> elements.
Handles four migration phases:
- Compiler properties (
maven.compiler.release,maven.compiler.source/target) →<source><targetVersion> - Compiler plugin configuration (
<release>,<source>/<target>) →<source><targetVersion> - Custom source/test directories →
<source>with<directory> - Resource directories →
<source>with<lang>resources</lang>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected UpgradeResultdoApply(UpgradeContext context, Map<Path, eu.maveniverse.domtrip.Document> pomMap) Subclasses implement the actual upgrade logic here.Gets a description of what this strategy does.booleanisApplicable(UpgradeContext context) Checks if this strategy is applicable given the current options.Methods inherited from class org.apache.maven.cling.invoker.mvnup.goals.AbstractUpgradeStrategy
apply, buildEffectiveModel, cleanupTempDirectory, computeAllArtifactCoordinates, createTempProjectStructure, extractArtifactCoordinatesWithParentResolution, findCommonRoot, getOptions, getSession, logSummaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.cling.invoker.mvnup.goals.UpgradeStrategy
isOptionEnabled
-
Constructor Details
-
SourceStrategy
public SourceStrategy()
-
-
Method Details
-
isApplicable
Description copied from interface:UpgradeStrategyChecks if this strategy is applicable given the current options.- Parameters:
context- the upgrade context- Returns:
- true if this strategy should be applied
-
getDescription
Description copied from interface:UpgradeStrategyGets a description of what this strategy does.- Returns:
- a human-readable description of the strategy
-
doApply
protected UpgradeResult doApply(UpgradeContext context, Map<Path, eu.maveniverse.domtrip.Document> pomMap) Description copied from class:AbstractUpgradeStrategySubclasses implement the actual upgrade logic here.- Specified by:
doApplyin classAbstractUpgradeStrategy- Parameters:
context- the upgrade contextpomMap- map of all POM files in the project- Returns:
- the result of the upgrade operation
-