mirror of https://github.com/apache/maven.git
[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:
parent
57568aa984
commit
81bd2d7cd1
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue