[MNG-4106] Interpolation does not use properties from dominant settings profile if other profile defines same property.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@762779 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-04-07 13:57:19 +00:00
parent 57568aa984
commit 81bd2d7cd1
2 changed files with 15 additions and 6 deletions

View File

@ -81,12 +81,21 @@ public class ProcessorContext
public static PomClassicDomainModel mergeProfilesIntoModel(Collection<Profile> profiles, PomClassicDomainModel domainModel) throws IOException
{
List<Model> profileModels = new ArrayList<Model>();
List<Model> externalProfileModels = new ArrayList<Model>();
for(Profile profile : profiles)
{
profileModels.add( attachProfileNodesToModel(profile) );
if("pom".equals(profile.getSource()))
{
profileModels.add( attachProfileNodesToModel(profile) );
}
else
{
externalProfileModels.add(attachProfileNodesToModel(profile));
}
}
Collections.reverse( profileModels );
profileModels.addAll(externalProfileModels);//external takes precedence
// Collections.reverse( profileModels );
Model model = domainModel.getModel();
profileModels.add( 0, model );

View File

@ -1242,16 +1242,16 @@ public class PomConstructionTest
}
/* MNG-2309*/
/*
public void testProfileInjectionOrder()
throws Exception
{
PomTestWrapper pom =
buildPom( "profile-injection-order", "pom-a", "pom-b", "pom-e", "pom-c", "pom-d" );
System.out.println(pom.getDomainModel().asString());
//System.out.println(pom.getDomainModel().asString());
assertEquals( "e", pom.getValue( "properties[1]/pomProperty" ) );
}
*/
public void testPropertiesInheritance()
throws Exception
{