You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2016/12/10 21:18:30 UTC

maven-integration-testing git commit: [MNG-597] Imported dependencies should be available to inheritance processing

Repository: maven-integration-testing
Updated Branches:
  refs/heads/master 9b71a0394 -> 27b3c96a4


[MNG-597] Imported dependencies should be available to inheritance processing

o Updated to account for introduction of 'include' scope.


Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/27b3c96a
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/27b3c96a
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/27b3c96a

Branch: refs/heads/master
Commit: 27b3c96a488399ccb0f6d1964b6a5a62510a6f74
Parents: 9b71a03
Author: Christian Schulte <sc...@apache.org>
Authored: Sat Dec 10 22:14:10 2016 +0100
Committer: Christian Schulte <sc...@apache.org>
Committed: Sat Dec 10 22:14:10 2016 +0100

----------------------------------------------------------------------
 ...venITmng5971HierarchicalImportScopeTest.java | 35 +++++++++
 .../mng-5971/include-properties/1/2/3/4/pom.xml | 47 ++++++++++++
 .../mng-5971/include-properties/1/2/3/pom.xml   | 51 +++++++++++++
 .../mng-5971/include-properties/1/2/pom.xml     | 50 ++++++++++++
 .../mng-5971/include-properties/1/pom.xml       | 50 ++++++++++++
 .../mng-5971/include-properties/pom.xml         | 80 ++++++++++++++++++++
 .../mng-5971/inheritance/1/2/3/pom.xml          |  2 +-
 .../resources/mng-5971/inheritance/1/2/pom.xml  |  2 +-
 .../resources/mng-5971/inheritance/1/pom.xml    |  2 +-
 9 files changed, 316 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java
index 080dbb6..c3c7e0a 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java
@@ -132,6 +132,41 @@ public class MavenITmng5971HierarchicalImportScopeTest
         assertTrue( contains( dependencies4, "org.apache.maven.its.mng5971:dependency:jar:3" ) );
     }
 
+    public void testIncludeInheritanceProcessingWithProjectBasedProperties()
+        throws Exception
+    {
+        final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5971/include-properties" );
+
+        final Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8",
+                             (Map) verifier.newDefaultFilterProperties() );
+
+        verifier.addCliOption( "-s" );
+        verifier.addCliOption( "settings.xml" );
+        verifier.executeGoals( Arrays.asList( new String[]
+        {
+            "clean", "verify"
+        } ) );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        final List<String> dependencies0 = verifier.loadLines( "target/compile.txt", "UTF-8" );
+        assertTrue( contains( dependencies0, "org.apache.maven.its.mng5971:dependency:jar:0" ) );
+
+        final List<String> dependencies1 = verifier.loadLines( "1/target/compile.txt", "UTF-8" );
+        assertTrue( contains( dependencies1, "org.apache.maven.its.mng5971:dependency:jar:1" ) );
+
+        final List<String> dependencies2 = verifier.loadLines( "1/2/target/compile.txt", "UTF-8" );
+        assertTrue( contains( dependencies2, "org.apache.maven.its.mng5971:dependency:jar:2" ) );
+
+        final List<String> dependencies3 = verifier.loadLines( "1/2/3/target/compile.txt", "UTF-8" );
+        assertTrue( contains( dependencies3, "org.apache.maven.its.mng5971:dependency:jar:3" ) );
+
+        final List<String> dependencies4 = verifier.loadLines( "1/2/3/4/target/compile.txt", "UTF-8" );
+        assertTrue( contains( dependencies4, "org.apache.maven.its.mng5971:dependency:jar:3" ) );
+    }
+
     private static boolean contains( final List<String> lines, final String pattern )
     {
         for ( int i = 0, l0 = lines.size(); i < l0; i++ )

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/4/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/4/pom.xml b/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/4/pom.xml
new file mode 100644
index 0000000..50b7175
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/4/pom.xml
@@ -0,0 +1,47 @@
+<?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.mng5971</groupId>
+    <artifactId>3</artifactId>
+    <version>3</version>
+  </parent>
+
+  <artifactId>4</artifactId>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>import</artifactId>
+        <!-- Test for version inheritance. -->
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>include</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/pom.xml b/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/pom.xml
new file mode 100644
index 0000000..42bccc8
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/3/pom.xml
@@ -0,0 +1,51 @@
+<?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.mng5971</groupId>
+    <artifactId>2</artifactId>
+    <version>2</version>
+  </parent>
+
+  <artifactId>3</artifactId>
+  <version>3</version>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>import</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>include</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <modules>
+    <module>4</module>
+  </modules>
+
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/pom.xml b/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/pom.xml
new file mode 100644
index 0000000..5b35e3a
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5971/include-properties/1/2/pom.xml
@@ -0,0 +1,50 @@
+<?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.mng5971</groupId>
+    <artifactId>1</artifactId>
+    <version>1</version>
+  </parent>
+
+  <artifactId>2</artifactId>
+  <version>2</version>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>import</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>include</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <modules>
+    <module>3</module>
+  </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/include-properties/1/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/include-properties/1/pom.xml b/core-it-suite/src/test/resources/mng-5971/include-properties/1/pom.xml
new file mode 100644
index 0000000..1f8f1a5
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5971/include-properties/1/pom.xml
@@ -0,0 +1,50 @@
+<?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.mng5971</groupId>
+    <artifactId>0</artifactId>
+    <version>0</version>
+  </parent>
+
+  <artifactId>1</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>import</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>include</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <modules>
+    <module>2</module>
+  </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/include-properties/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/include-properties/pom.xml b/core-it-suite/src/test/resources/mng-5971/include-properties/pom.xml
new file mode 100644
index 0000000..647cf5c
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5971/include-properties/pom.xml
@@ -0,0 +1,80 @@
+<?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.mng5971</groupId>
+  <artifactId>0</artifactId>
+  <version>0</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-5971</name>
+
+  <description>
+    Multi module project using dependency management include at each child level testing import are performed on each
+    level and overriden correctly when using inherited ${project.groupId} and ${project.version} expressions in
+    dependency management import declarations.
+  </description>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>dependency</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng5971</groupId>
+      <artifactId>dependency</artifactId>
+    </dependency>
+  </dependencies>
+
+  <modules>
+    <module>1</module>
+  </modules>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <compileArtifacts>target/compile.txt</compileArtifacts>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/3/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/3/pom.xml b/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/3/pom.xml
index 54a3f71..d0bcbd9 100644
--- a/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/3/pom.xml
+++ b/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/3/pom.xml
@@ -38,7 +38,7 @@ under the License.
         <artifactId>import</artifactId>
         <version>3</version>
         <type>pom</type>
-        <scope>import</scope>
+        <scope>include</scope>
       </dependency>
     </dependencies>
   </dependencyManagement>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/pom.xml b/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/pom.xml
index 76a1fdb..4797c68 100644
--- a/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/pom.xml
+++ b/core-it-suite/src/test/resources/mng-5971/inheritance/1/2/pom.xml
@@ -38,7 +38,7 @@ under the License.
         <artifactId>import</artifactId>
         <version>2</version>
         <type>pom</type>
-        <scope>import</scope>
+        <scope>include</scope>
       </dependency>
     </dependencies>
   </dependencyManagement>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/27b3c96a/core-it-suite/src/test/resources/mng-5971/inheritance/1/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5971/inheritance/1/pom.xml b/core-it-suite/src/test/resources/mng-5971/inheritance/1/pom.xml
index 8f4cd52..c7e3f9c 100644
--- a/core-it-suite/src/test/resources/mng-5971/inheritance/1/pom.xml
+++ b/core-it-suite/src/test/resources/mng-5971/inheritance/1/pom.xml
@@ -38,7 +38,7 @@ under the License.
         <artifactId>import</artifactId>
         <version>1</version>
         <type>pom</type>
-        <scope>import</scope>
+        <scope>include</scope>
       </dependency>
     </dependencies>
   </dependencyManagement>