maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r762767 - in /maven/components/trunk/maven-project/src: main/java/org/apache/maven/profiles/ test/java/org/apache/maven/project/ test/resources-project-builder/profile-default-deactivation/
Date Wed, 08 Apr 2009 04:10:52 GMT
Author: sisbell
Date: Tue Apr  7 13:28:02 2009
New Revision: 762767

URL: http://svn.apache.org/viewvc?rev=762767&view=rev
Log:
[MNG-3545] overridden if profile is activebyDefault. Fixed and added unit test.

Added:
    maven/components/trunk/maven-project/src/test/resources-project-builder/profile-default-deactivation/
    maven/components/trunk/maven-project/src/test/resources-project-builder/profile-default-deactivation/pom.xml
Modified:
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
    maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java?rev=762767&r1=762766&r2=762767&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
Tue Apr  7 13:28:02 2009
@@ -50,7 +50,7 @@
     private static final ProfileMatcher defaultMatcher = new DefaultMatcher();
 
     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
@@ -207,7 +207,7 @@
 	    {           
 	    	projectProfiles.addAll( externalProfileManager.getActiveProfiles() );    
 	    }
-	
+
 	    ProfileManager profileManager = new DefaultProfileManager( container, profileActivationContext
);
 	    profileManager.addProfiles( model.getProfiles() );
 	    projectProfiles.addAll( profileManager.getActiveProfiles() ); 

Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java?rev=762767&r1=762766&r2=762767&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java
(original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java
Tue Apr  7 13:28:02 2009
@@ -1284,6 +1284,16 @@
         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 
     public void testBooleanInterpolation()
         throws Exception
@@ -1297,7 +1307,6 @@
         throws Exception
     {
         PomTestWrapper pom = buildPom( "build-extension-inheritance/sub" ); 
-        System.out.println(pom.getDomainModel().asString());
         assertEquals(3, ( (List<?>) pom.getValue( "build/extensions" )).size() );
         assertEquals("b", pom.getValue( "build/extensions[1]/artifactId" ) );
         assertEquals("a", pom.getValue( "build/extensions[2]/artifactId" ) );

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-default-deactivation/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/profile-default-deactivation/pom.xml?rev=762767&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/profile-default-deactivation/pom.xml
(added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/profile-default-deactivation/pom.xml
Tue Apr  7 13:28:02 2009
@@ -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>



Mime
View raw message