You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/03/03 14:24:44 UTC

svn commit: r749613 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-4056/ resources/mng-4056/consumer/ resources/mng-4056/producer/

Author: bentmann
Date: Tue Mar  3 13:24:44 2009
New Revision: 749613

URL: http://svn.apache.org/viewvc?rev=749613&view=rev
Log:
[MNG-4056] Relax resolution of active project artifacts from the reactor with regard to artifact type

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/client.jar
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/javadoc.jar
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/source.jar
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/test.jar
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=749613&r1=749612&r2=749613&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Tue Mar  3 13:24:44 2009
@@ -91,6 +91,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.class );
         suite.addTestSuite( MavenITmng4053PluginConfigAttributesTest.class );
         suite.addTestSuite( MavenITmng4040ProfileInjectedModulesTest.class );
         suite.addTestSuite( MavenITmng4036ParentResolutionFromSettingsRepoTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java?rev=749613&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java Tue Mar  3 13:24:44 2009
@@ -0,0 +1,69 @@
+package org.apache.maven.it;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4056">MNG-4056</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4056ClassifierBasedDepResolutionFromReactorTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4056ClassifierBasedDepResolutionFromReactorTest()
+    {
+        super( "[2.1.0,)" );
+    }
+
+    /**
+     * Test that attached artifacts can be resolved from the reactor cache even if the dependency declaration
+     * in the consumer module does not use the proper artifact type but merely specifies the classifier.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4056" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "consumer/target" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        List artifacts = verifier.loadLines( "consumer/target/artifacts.txt", "UTF-8" );
+        assertTrue( artifacts.toString(), 
+            artifacts.contains( "org.apache.maven.its.mng4056:producer:test-jar:tests:0.1" ) );
+        assertTrue( artifacts.toString(), 
+            artifacts.contains( "org.apache.maven.its.mng4056:producer:java-source:sources:0.1" ) );
+        assertTrue( artifacts.toString(), 
+            artifacts.contains( "org.apache.maven.its.mng4056:producer:javadoc:javadoc:0.1" ) );
+        assertTrue( artifacts.toString(), 
+            artifacts.contains( "org.apache.maven.its.mng4056:producer:ejb-client:client:0.1" ) );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml?rev=749613&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml Tue Mar  3 13:24:44 2009
@@ -0,0 +1,96 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4056</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1</version>
+  </parent>
+
+  <artifactId>consumer</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4056 :: Dependency Consumer</name>
+  <description>
+    Test that attached artifacts can be resolved from the reactor cache even if the dependency declaration
+    in the consumer module does not use the proper artifact type but merely specifies the classifier.
+  </description>
+
+  <dependencies>
+    <!--
+    NOTE: It is essential part of this test that all dependencies use <type>jar</type> and merely specify the
+    classifier instead.
+    -->
+    <dependency>
+      <groupId>org.apache.maven.its.mng4056</groupId>
+      <artifactId>producer</artifactId>
+      <version>0.1</version>
+      <type>jar</type>
+      <classifier>tests</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.mng4056</groupId>
+      <artifactId>producer</artifactId>
+      <version>0.1</version>
+      <type>jar</type>
+      <classifier>sources</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.mng4056</groupId>
+      <artifactId>producer</artifactId>
+      <version>0.1</version>
+      <type>jar</type>
+      <classifier>javadoc</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.mng4056</groupId>
+      <artifactId>producer</artifactId>
+      <version>0.1</version>
+      <type>jar</type>
+      <classifier>client</classifier>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>package</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+            <configuration>
+              <projectArtifacts>target/artifacts.txt</projectArtifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/consumer/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml?rev=749613&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml Tue Mar  3 13:24:44 2009
@@ -0,0 +1,40 @@
+<?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.mng4056</groupId>
+  <artifactId>parent</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4056</name>
+  <description>
+    Test that attached artifacts can be resolved from the reactor cache even if the dependency declaration
+    in the consumer module does not use the proper artifact type but merely specifies the classifier.
+  </description>
+
+  <modules>
+    <module>producer</module>
+    <module>consumer</module>
+  </modules>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/client.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/client.jar?rev=749613&view=auto
==============================================================================
    (empty)

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/javadoc.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/javadoc.jar?rev=749613&view=auto
==============================================================================
    (empty)

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml?rev=749613&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml Tue Mar  3 13:24:44 2009
@@ -0,0 +1,114 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4056</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1</version>
+  </parent>
+
+  <artifactId>producer</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4056 :: Dependency Producer</name>
+  <description>
+    Test that attached artifacts can be resolved from the reactor cache even if the dependency declaration
+    in the consumer module does not use the proper artifact type but merely specifies the classifier.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-artifact</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>package</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>set</goal>
+            </goals>
+            <configuration>
+              <mainFile>pom.xml</mainFile>
+            </configuration>
+          </execution>
+          <!-- NOTE: It is essential part of this test to attach the artifacts using the dedicated artifact type -->
+          <execution>
+            <id>package-tests</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>attach</goal>
+            </goals>
+            <configuration>
+              <!-- mimic maven-jar-plugin:2.2:test-jar -->
+              <attachedFile>test.jar</attachedFile>
+              <artifactType>test-jar</artifactType>
+              <artifactClassifier>tests</artifactClassifier>
+            </configuration>
+          </execution>
+          <execution>
+            <id>package-sources</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>attach</goal>
+            </goals>
+            <configuration>
+              <!-- mimic maven-source-plugin:2.0.4:jar -->
+              <attachedFile>source.jar</attachedFile>
+              <artifactType>java-source</artifactType>
+              <artifactClassifier>sources</artifactClassifier>
+            </configuration>
+          </execution>
+          <execution>
+            <id>package-javadocs</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>attach</goal>
+            </goals>
+            <configuration>
+              <!-- mimic maven-javadoc-plugin:2.5:jar -->
+              <attachedFile>javadoc.jar</attachedFile>
+              <artifactType>javadoc</artifactType>
+              <artifactClassifier>javadoc</artifactClassifier>
+            </configuration>
+          </execution>
+          <execution>
+            <id>package-client</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>attach</goal>
+            </goals>
+            <configuration>
+              <!-- mimic maven-ejb-plugin:2.1:ejb -->
+              <attachedFile>client.jar</attachedFile>
+              <artifactType>ejb-client</artifactType>
+              <artifactClassifier>client</artifactClassifier>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/source.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/source.jar?rev=749613&view=auto
==============================================================================
    (empty)

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/test.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4056/producer/test.jar?rev=749613&view=auto
==============================================================================
    (empty)