You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stuart McCulloch (JIRA)" <ji...@codehaus.org> on 2013/03/05 16:48:52 UTC
[jira] (MNG-5445) Missing PathTranslator @Requirement in
org.apache.maven.project.interpolation.StringSearchModelInterpolator
Stuart McCulloch created MNG-5445:
-------------------------------------
Summary: Missing PathTranslator @Requirement in org.apache.maven.project.interpolation.StringSearchModelInterpolator
Key: MNG-5445
URL: https://jira.codehaus.org/browse/MNG-5445
Project: Maven 2 & 3
Issue Type: Bug
Affects Versions: 3.0.4
Reporter: Stuart McCulloch
In Maven 2.2.1 the StringSearchModelInterpolator component had an explicit PathTranslator requirement defined in the following components.xml:
https://github.com/apache/maven/blob/maven-2.2.1/maven-project/src/main/resources/META-INF/plexus/components.xml#L53
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:
https://github.com/apache/maven/blob/master/maven-compat/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java#L91
This is the root cause of https://jira.codehaus.org/browse/MVERSIONS-205
Suggested patch:
{code}
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;
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira