mirror of https://github.com/apache/maven.git
[MNG-3545] overridden if profile is activebyDefault. Fixed and added unit test.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@762767 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5ae7bdc3fd
commit
57568aa984
|
@ -50,7 +50,7 @@ public class DefaultProfileManager
|
||||||
private static final ProfileMatcher defaultMatcher = new DefaultMatcher();
|
private static final ProfileMatcher defaultMatcher = new DefaultMatcher();
|
||||||
|
|
||||||
private static final List<ProfileMatcher> matchers =
|
private static final List<ProfileMatcher> matchers =
|
||||||
(List<ProfileMatcher>) Collections.unmodifiableList( Arrays.asList( new DefaultMatcher(), new PropertyMatcher(), new FileMatcher() ) );
|
(List<ProfileMatcher>) Collections.unmodifiableList( Arrays.asList( new PropertyMatcher(), new FileMatcher() ) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the properties passed to the profile manager are the props that
|
* the properties passed to the profile manager are the props that
|
||||||
|
|
|
@ -1284,6 +1284,16 @@ public class PomConstructionTest
|
||||||
assertEquals( "CHILD", pom.getValue( "properties/interpolated" ) );
|
assertEquals( "CHILD", pom.getValue( "properties/interpolated" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MNG-3545 */
|
||||||
|
public void testProfileDefaultActivation()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
PomTestWrapper pom = buildPom( "profile-default-deactivation" , "profile4");
|
||||||
|
assertEquals(1, pom.getMavenProject().getActiveProfiles().size() );
|
||||||
|
assertEquals(1, ( (List<?>) pom.getValue( "build/plugins" )).size() );
|
||||||
|
assertEquals("2.1", pom.getValue( "build/plugins[1]/version" ));
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: MNG-1995
|
/* FIXME: MNG-1995
|
||||||
public void testBooleanInterpolation()
|
public void testBooleanInterpolation()
|
||||||
throws Exception
|
throws Exception
|
||||||
|
@ -1297,7 +1307,6 @@ public class PomConstructionTest
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
PomTestWrapper pom = buildPom( "build-extension-inheritance/sub" );
|
PomTestWrapper pom = buildPom( "build-extension-inheritance/sub" );
|
||||||
System.out.println(pom.getDomainModel().asString());
|
|
||||||
assertEquals(3, ( (List<?>) pom.getValue( "build/extensions" )).size() );
|
assertEquals(3, ( (List<?>) pom.getValue( "build/extensions" )).size() );
|
||||||
assertEquals("b", pom.getValue( "build/extensions[1]/artifactId" ) );
|
assertEquals("b", pom.getValue( "build/extensions[1]/artifactId" ) );
|
||||||
assertEquals("a", pom.getValue( "build/extensions[2]/artifactId" ) );
|
assertEquals("a", pom.getValue( "build/extensions[2]/artifactId" ) );
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.apache.maven.its.mng3545</groupId>
|
||||||
|
<artifactId>test-artifact</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>profile1</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-touch</artifactId>
|
||||||
|
<version>2.2</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>profile4</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-touch</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
</project>
|
Loading…
Reference in New Issue