Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.4
-
None
-
None
-
Patch
Description
In Maven 2.2.1 the StringSearchModelInterpolator component had an explicit PathTranslator requirement defined in the following components.xml:
In Maven 3.x this component became part of the maven-compat module, and while other components had their XML requirements turned into @Requirement annotations, this was not done for the PathTranslator field declared in StringSearchModelInterpolator's superclass:
This is the root cause of https://jira.codehaus.org/browse/MVERSIONS-205
Suggested patch:
diff --git a/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java b/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java index c77aebd..2190267 100644 --- a/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java +++ b/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java @@ -25,6 +25,7 @@ import org.apache.maven.model.io.xpp3.MavenXpp3Writer; import org.apache.maven.project.DefaultProjectBuilderConfiguration; import org.apache.maven.project.ProjectBuilderConfiguration; import org.apache.maven.project.path.PathTranslator; +import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.interpolation.AbstractValueSource; import org.codehaus.plexus.interpolation.InterpolationException; import org.codehaus.plexus.interpolation.InterpolationPostProcessor; @@ -88,6 +89,7 @@ public abstract class AbstractStringBasedModelInterpolator TRANSLATED_PATH_EXPRESSIONS = translatedPrefixes; } + @Requirement private PathTranslator pathTranslator; private Interpolator interpolator;