Author: jdcasey Date: Tue Apr 28 18:25:02 2009 New Revision: 769490 URL: http://svn.apache.org/viewvc?rev=769490&view=rev Log: [MNG-4137] Fix initialization of DefaultLifecycleExecutor to support legacy derivative component definitions like Hudson's, which don't map in the new configInterpolator field. This is the same situation as had been reported for the modelInterpolator field previously.
Modified: maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Modified: maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java?rev=769490&r1=769489&r2=769490&view=diff ============================================================================== --- maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java (original) +++ maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java Tue Apr 28 18:25:02 2009 @@ -6,6 +6,8 @@ public interface ConfigurationInterpolator { + String ROLE = ConfigurationInterpolator.class.getName(); + Object interpolate( Object configObject, MavenProject project, ProjectBuilderConfiguration config ) throws ConfigurationInterpolationException; Modified: maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=769490&r1=769489&r2=769490&view=diff ============================================================================== --- maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original) +++ maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Tue Apr 28 18:25:02 2009 @@ -1957,6 +1957,19 @@ throw new InitializationException( "Failed to lookup model interpolator after it was NOT injected via component requirement." ); } } + + if ( configInterpolator == null ) + { + warnOfIncompleteComponentConfiguration( ConfigurationInterpolator.ROLE ); + try + { + configInterpolator = (ConfigurationInterpolator) container.lookup( ConfigurationInterpolator.ROLE ); + } + catch ( ComponentLookupException e ) + { + throw new InitializationException( "Failed to lookup plugin-configuration interpolator after it was NOT injected via component requirement." ); + } + } } private void warnOfIncompleteComponentConfiguration( String role )