[MNG-2591 - Plugin config inheritance.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@758121 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-03-25 01:39:38 +00:00
parent 98ed6538fa
commit fc83f1f70b
6 changed files with 25 additions and 33 deletions

View File

@ -257,20 +257,7 @@ public class DefaultMavenProjectBuilder
{
request.setRemoteRepostories( new ArrayList<ArtifactRepository>() );
}
/*
if(project.getRemoteArtifactRepositories() == null)
{
try
{
System.out.println(convertToDomainModel(project.getModel(), true).asString());
}
catch ( IOException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
*/
ArtifactResolutionResult result = repositorySystem.resolve( request );
if ( result.hasExceptions() )
@ -323,7 +310,8 @@ public class DefaultMavenProjectBuilder
throw new ProjectBuildingException( projectId, "Failed to activate external profiles.", projectDescriptor, e );
}
}
if(!projectProfiles.isEmpty())
{
try
{
PomClassicDomainModel dm = ProcessorContext.mergeProfilesIntoModel( projectProfiles, model, false );
@ -337,6 +325,7 @@ public class DefaultMavenProjectBuilder
throw new ProjectBuildingException(projectId, "", projectDescriptor, e);
}
}
MavenProject project;

View File

@ -21,7 +21,9 @@ package org.apache.maven.project.processor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
@ -151,6 +153,5 @@ public class ModelProcessor
}
t.getDependencyManagement().getDependencies().addAll( mngDeps );
}
}
}

View File

@ -44,7 +44,7 @@ public class PluginsManagementProcessor extends BaseProcessor
{
for(Plugin targetDep : targetPlugin)
{ //PluginManagement is first in ordering
if(match(depMng, targetDep))
if(match(depMng, targetDep) )
{
copy(depMng, targetDep );
}

View File

@ -251,12 +251,14 @@ public class ProcessorContext
}
// Plugin Management
PluginsManagementProcessor procMng = new PluginsManagementProcessor();
if ( target.getBuild() != null && target.getBuild().getPluginManagement() != null)
{
procMng.process( null, new ArrayList<Plugin>( target.getBuild().getPluginManagement().getPlugins() ),
target.getBuild().getPlugins(), true );
}
return target;
}

View File

@ -258,7 +258,6 @@ public class PomConstructionTest
throws Exception
{
PomTestWrapper pom = buildPom( "equal-plugin-exec-ids" );
System.out.println(pom.getDomainModel().asString());
assertEquals( "maven-it-plugin-a", pom.getValue( "build/plugins[1]/artifactId" ) );
assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() );
assertEquals( "maven-it-plugin-b", pom.getValue( "build/plugins[2]/artifactId" ) );
@ -498,7 +497,7 @@ public class PomConstructionTest
throws Exception
{
PomTestWrapper pom = buildPom( "merged-plugin-class-path-order/wo-plugin-mngt/sub" );
System.out.println(pom.getDomainModel().asString());
assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() );
assertNotNull( pom.getValue( "build/plugins[1]/dependencies[1]" ));
assertEquals( "c", pom.getValue( "build/plugins[1]/dependencies[1]/artifactId" ) );
@ -627,7 +626,7 @@ public class PomConstructionTest
throws Exception
{
PomTestWrapper pom = buildPom( "unprefixed-expression-interpolation/child" );
System.out.println(pom.getDomainModel().asString());
assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/projectDir" ).toString() ) );
assertEquals( "org.apache.maven.its.mng3831.child", pom.getValue( "properties/projectGroupId" ) );
@ -761,11 +760,12 @@ public class PomConstructionTest
assertEquals( "PASSED-4", pom.getValue( prefix + "listParam/listParam[4]" ) );
}
/* FIXME: MNG-2591
/* FIXME: MNG-2591*/
public void testAppendOfInheritedPluginConfiguration()
throws Exception
{
PomTestWrapper pom = buildPom( "plugin-config-append/subproject" );
String prefix = "build/plugins[1]/configuration/";
assertEquals( "PARENT-1", pom.getValue( prefix + "stringParams/stringParam[1]" ) );
assertEquals( "PARENT-3", pom.getValue( prefix + "stringParams/stringParam[2]" ) );