maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r743083 - in /maven/components/trunk/maven-project/src/test: java/org/apache/maven/project/builder/ resources-project-builder/profile-injected-dependencies/
Date Tue, 10 Feb 2009 20:20:48 GMT
Author: bentmann
Date: Tue Feb 10 20:20:47 2009
New Revision: 743083

URL: http://svn.apache.org/viewvc?rev=743083&view=rev
Log:
[MNG-4027] [regression] Injection of dependencies from profiles crashes project builder

o Added UT

Added:
    maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/
  (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
  (with props)
Modified:
    maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java

Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java?rev=743083&r1=743082&r2=743083&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
(original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
Tue Feb 10 20:20:47 2009
@@ -28,7 +28,6 @@
 import org.apache.maven.profiles.DefaultProfileManager;
 import org.apache.maven.profiles.activation.DefaultProfileActivationContext;
 import org.apache.maven.profiles.activation.ProfileActivationContext;
-import org.apache.maven.shared.model.InterpolatorProperty;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -40,8 +39,6 @@
 import org.apache.maven.project.ProjectBuilderConfiguration;
 import org.apache.maven.project.DefaultProjectBuilderConfiguration;
 import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.configuration.PlexusConfiguration;
-import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 public class PomConstructionTest
@@ -513,7 +510,7 @@
         assertEquals( "e", pom.getValue( "build/plugins[1]/dependency[5]/artifactId" ) );
         assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[5]/version" ) );
     }
-   */
+   //*/
 
     public void testInterpolationOfNestedBuildDirectories()
         throws Exception
@@ -821,6 +818,18 @@
         assertTrue( pom.getValue( "build/filters[7]" ).toString().endsWith( "parent-d.properties"
) );
     }
 
+    /** MNG-4027
+    public void testProjectInjectedDependencies()
+        throws Exception
+    {
+        PomTestWrapper pom = buildPom( "profile-injected-dependencies" );
+        assertEquals( 4, ( (List<?>) pom.getValue( "dependencies" ) ).size() );
+        assertEquals( "a", pom.getValue( "dependencies[1]/artifactId" ) );
+        assertEquals( "c", pom.getValue( "dependencies[2]/artifactId" ) );
+        assertEquals( "b", pom.getValue( "dependencies[3]/artifactId" ) );
+        assertEquals( "d", pom.getValue( "dependencies[4]/artifactId" ) );
+    }
+    //*/
 
     private void assertPathWithNormalizedFileSeparators( Object value )
     {

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml?rev=743083&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
(added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
Tue Feb 10 20:20:47 2009
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng1412</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1-SNAPSHOT</version>
+
+  <name>Maven Integration Test :: MNG-1412</name> 
+  <description>
+    Check that dependencies are available in classpath in same order as declared in POM.
+  </description>
+
+  <dependencies>
+    <!-- model dependencies first, in the order given -->
+    <dependency>
+      <groupId>org.apache.maven.its.mng1412</groupId>
+      <artifactId>a</artifactId>
+      <version>0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.mng1412</groupId>
+      <artifactId>c</artifactId>
+      <version>0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.mng1412</groupId>
+      <artifactId>b</artifactId>
+      <version>0.1</version>
+    </dependency>
+  </dependencies>
+
+  <profiles>
+    <profile>
+      <id>mng-1412</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <!-- profile dependencies last, in the order given -->
+      <dependencies>
+        <dependency>
+          <!-- deliberately respecifying this dep to check merging behavior -->
+          <groupId>org.apache.maven.its.mng1412</groupId>
+          <artifactId>a</artifactId>
+          <version>0.1</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.maven.its.mng1412</groupId>
+          <artifactId>d</artifactId>
+          <version>0.1</version>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
+</project>

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/profile-injected-dependencies/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message