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

[maven-integration-testing] branch MNG-6957_squashed created (now 386876a)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch MNG-6957_squashed
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git.


      at 386876a  [MNG-6957] versionless reactor dependencies/parent should work even if modules are aggregated in reverse order

This branch includes the following new commits:

     new 386876a  [MNG-6957] versionless reactor dependencies/parent should work even if modules are aggregated in reverse order

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-integration-testing] 01/01: [MNG-6957] versionless reactor dependencies/parent should work even if modules are aggregated in reverse order

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-6957_squashed
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 386876a11dc2b47a5c8fadea7825edac1028b7e3
Author: rfscholte <rf...@apache.org>
AuthorDate: Mon Dec 21 22:20:45 2020 +0100

    [MNG-6957] versionless reactor dependencies/parent should work even if modules are aggregated in reverse order
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  2 +-
 .../maven/it/MavenITmng5576CdFriendlyVersions.java | 32 ++++++-
 .../maven/it/MavenITmng5669ReadPomsOnce.java       |  3 +-
 ...enITmng5895CIFriendlyUsageWithPropertyTest.java | 22 ++++-
 .../maven/it/MavenITmng6090CIFriendlyTest.java     | 29 ++++++-
 .../maven/it/MavenITmng6957BuildConsumer.java      | 97 ++++++++++++++++++++++
 .../mng-6957-buildconsumer/expected/parent.pom     | 28 +++++++
 .../expected/simple-parent.pom                     | 43 ++++++++++
 .../expected/simple-testutils.pom                  | 26 ++++++
 .../expected/simple-weather.pom                    | 39 +++++++++
 .../expected/simple-webapp.pom                     | 47 +++++++++++
 .../expected/utils-parent.pom                      | 27 ++++++
 .../test/resources/mng-6957-buildconsumer/pom.xml  | 36 ++++++++
 .../mng-6957-buildconsumer/simple-parent/pom.xml   | 56 +++++++++++++
 .../simple-parent/simple-testutils/pom.xml         | 32 +++++++
 .../simple-parent/simple-weather/pom.xml           | 43 ++++++++++
 .../simple-parent/simple-webapp/pom.xml            | 51 ++++++++++++
 .../simple-parent/utils-parent/pom.xml             | 32 +++++++
 18 files changed, 640 insertions(+), 5 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index 5c78f9a..465179c 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -106,7 +106,7 @@ public class IntegrationTestSuite
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
-
+        suite.addTestSuite( MavenITmng6957BuildConsumer.class );
         suite.addTestSuite( MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.class );
         suite.addTestSuite( MavenITmng6754TimestampInMultimoduleProject.class );
         suite.addTestSuite( MavenITmng6981ProjectListShouldIncludeChildrenTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java
index d66b6ec..d68d79d 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java
@@ -43,7 +43,7 @@ public class MavenITmng5576CdFriendlyVersions
      * Verifies that property references with dotted notation work within
      * POM interpolation.
      */
-    public void testContinuousDeliveryFriendlyVersionsAreWarningFree()
+    public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithoutBuildConsumer()
         throws Exception
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5576-cd-friendly-versions" );
@@ -52,6 +52,7 @@ public class MavenITmng5576CdFriendlyVersions
         verifier.setAutoclean( false );
         verifier.deleteDirectory( "target" );
         verifier.addCliOption( "-Dchangelist=changelist" ); 
+        verifier.addCliOption( "-Dmaven.experimental.buildconsumer=false" );
         verifier.executeGoal( "validate" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
@@ -66,4 +67,33 @@ public class MavenITmng5576CdFriendlyVersions
         }
     }
 
+    /**
+     * Verifies that property references with dotted notation work within
+     * POM interpolation.
+     */
+    public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithBuildConsumer()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5576-cd-friendly-versions" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setLogFileName( "log-bc.txt" );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.addCliOption( "-Dchangelist=changelist" ); 
+        verifier.addCliOption( "-Dmaven.experimental.buildconsumer=true" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( "target/pom.properties" );
+        assertEquals( "1.0.0.changelist", props.getProperty( "project.version" ) );
+        
+        List<String> lines = verifier.loadFile( new File( testDir, "log-bc.txt" ), false );
+        for( String line : lines )
+        {
+            assertFalse( line, line.contains( "WARNING" ) );
+        }
+    }
+
 }
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java
index 5ce5331..de432d5 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java
@@ -109,6 +109,7 @@ public class MavenITmng5669ReadPomsOnce
                                       verifier.getArtifactPath( "mng-coreit", "javaagent", "1.0-SNAPSHOT", "jar" ) );
         verifier.filterFile( ".mvn/jvm.config", ".mvn/jvm.config", null, filterProperties );
 
+        verifier.setLogFileName( "log-bc.txt" );
         verifier.setForkJvm( true ); // pick up agent
         verifier.setMavenDebug( false );
         verifier.setAutoclean( false );
@@ -118,7 +119,7 @@ public class MavenITmng5669ReadPomsOnce
         verifier.executeGoals( Arrays.asList( "verify" ) );
         verifier.resetStreams();
 
-        List<String> logTxt = verifier.loadLines( "log.txt", "utf-8" );
+        List<String> logTxt = verifier.loadLines( "log-bc.txt", "utf-8" );
         for ( String line : logTxt )
         {
             if ( line.startsWith( "Picked up JAVA_TOOL_OPTIONS:" ) )
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java
index 7d13fd4..5d0db85 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java
@@ -49,7 +49,7 @@ public class MavenITmng5895CIFriendlyUsageWithPropertyTest
      * of defining the property via command line which is
      * already defined inside the pom. 
      */
-    public void testitShouldResolveTheDependencies()
+    public void testitShouldResolveTheDependenciesWithoutBuildConsumer()
         throws Exception
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5895-ci-friendly-usage-with-property" );
@@ -60,6 +60,7 @@ public class MavenITmng5895CIFriendlyUsageWithPropertyTest
 
         //verifier.setLogFileName( "log-only.txt" );
         verifier.addCliOption( "-Drevision=1.2" );
+        verifier.addCliOption( "-Dmaven.experimental.buildconsumer=false" );
         verifier.executeGoal( "clean" );
         verifier.executeGoal( "package" );
         verifier.verifyErrorFreeLog();
@@ -67,4 +68,23 @@ public class MavenITmng5895CIFriendlyUsageWithPropertyTest
 
     }
 
+    public void testitShouldResolveTheDependenciesWithBuildConsumer()
+                    throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5895-ci-friendly-usage-with-property" );
+        
+        Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
+        verifier.setMavenDebug( false );
+        verifier.setAutoclean( false );
+        
+        verifier.setLogFileName( "log-bc.txt" );
+        verifier.addCliOption( "-Drevision=1.2" );
+        verifier.addCliOption( "-Dmaven.experimental.buildconsumer=true" );
+        verifier.executeGoal( "clean" );
+        verifier.executeGoal( "package" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+    }
+    
 }
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
index 77b7248..e9d3abe 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
@@ -50,7 +50,7 @@ public class MavenITmng6090CIFriendlyTest
      * install the projects and afterwards just build
      * a part of the whole reactor.
      */
-    public void testitShouldResolveTheDependencies()
+    public void testitShouldResolveTheDependenciesWithoutBuildConsumer()
         throws Exception
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6090-ci-friendly" );
@@ -60,6 +60,7 @@ public class MavenITmng6090CIFriendlyTest
         verifier.setAutoclean( false );
         
         verifier.addCliOption( "-Drevision=1.2" );
+        verifier.addCliOption( "-Dmaven.experimental.buildconsumer=false" );
         verifier.setLogFileName( "install-log.txt" );
         verifier.executeGoals( Arrays.asList( "clean", "install" ) );
         verifier.verifyErrorFreeLog();
@@ -74,7 +75,33 @@ public class MavenITmng6090CIFriendlyTest
         verifier.executeGoal( "package" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
+    }
 
+    public void testitShouldResolveTheDependenciesWithBuildConsumer()
+                    throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6090-ci-friendly" );
+        
+        Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
+        verifier.setMavenDebug( false );
+        verifier.setAutoclean( false );
+        
+        verifier.addCliOption( "-Drevision=1.2" );
+        verifier.addCliOption( "-Dmaven.experimental.buildconsumer=true" );
+        verifier.setLogFileName( "install-log.txt" );
+        verifier.executeGoals( Arrays.asList( "clean", "install" ) );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier = newVerifier( testDir.getAbsolutePath(), false );
+        verifier.setMavenDebug( false );
+        verifier.setAutoclean( false );
+        
+        verifier.addCliOption( "-Drevision=1.2" );
+        verifier.addCliOption( "-pl module-3" );
+        verifier.executeGoal( "package" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
     }
 
 }
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java
new file mode 100644
index 0000000..147edb4
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java
@@ -0,0 +1,97 @@
+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.util.ResourceExtractor;
+import org.apache.maven.shared.utils.io.FileUtils;
+
+import java.io.File;
+import java.util.Arrays;
+
+/**
+ * With the build-consumer the POM will be adjusted during the process.
+ * <ul>
+ *   <li>CI-friendly versions will be resolved</li>
+ *   <li>parents can omit the version if the relative path points to the correct parent</li>
+ *   <li>dependencies can omit the version if it is part of the reactor</li>
+ * </ul>
+ * 
+ * During install the POM will be cleaned up
+ * <ul>
+ *   <li>the modules will be removed</li>
+ *   <li>the relativePath will be removed</li>
+ * </ul>
+ *
+ * <a href="https://issues.apache.org/jira/browse/MNG-6656">MNG-6656</a>.
+ *
+ */
+public class MavenITmng6957BuildConsumer
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng6957BuildConsumer()
+    {
+        super( "[4.0.0-alpha-1,)" );
+    }
+
+    /**
+     * Verifies:
+     * <ul>
+     *   <li>preserve license</li>
+     *   <li>consistent line separators</li>
+     *   <li>resolved project versions (at least 2 levels deep) in parent and dependencies</li>
+     *   <li>removal of modules in aggregators</li>
+     * </ul>
+     * @throws Exception
+     */
+    public void testPublishedPoms()
+                    throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6957-buildconsumer" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
+        verifier.setMavenDebug( false );
+        verifier.setAutoclean( false );
+        verifier.addCliOption( "-Dchangelist=MNG6957" );
+
+        verifier.executeGoals( Arrays.asList( "install" ) );
+        verifier.verifyErrorFreeLog();
+
+        String content;
+        content = FileUtils.fileRead( new File( testDir, "expected/parent.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6957-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( testDir, "expected/simple-parent.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6957-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( testDir, "expected/simple-weather.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6957-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( testDir, "expected/simple-webapp.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6957-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( testDir, "expected/simple-testutils.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-testutils", "0.9-MNG6957-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( testDir, "expected/utils-parent.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "utils-parent", "0.9-MNG6957-SNAPSHOT", "pom", content );
+    }
+
+}
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom
new file mode 100644
index 0000000..bfe5879
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/parent.pom
@@ -0,0 +1,28 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.sonatype.mavenbook.multi</groupId>
+  <artifactId>parent</artifactId>
+  <version>0.9-MNG6957-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Multi Chapter Parent Project</name>
+
+  <!-- Optimized from https://github.com/sonatype/maven-example-en/tree/master/examples/ch-multi -->
+  
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom
new file mode 100644
index 0000000..843f219
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-parent.pom
@@ -0,0 +1,43 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+  	<groupId>org.sonatype.mavenbook.multi</groupId>
+  	<artifactId>parent</artifactId>
+  	<version>0.9-MNG6957-SNAPSHOT</version>
+  </parent>
+  <artifactId>simple-parent</artifactId>
+  <packaging>pom</packaging>
+  <name>Multi Chapter Simple Parent Project</name>
+ 
+  
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>0.1-stub-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom
new file mode 100644
index 0000000..ce7a73c
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-testutils.pom
@@ -0,0 +1,26 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonatype.mavenbook.multi</groupId>
+    <artifactId>utils-parent</artifactId>
+    <version>0.9-MNG6957-SNAPSHOT</version>
+  </parent>
+  <artifactId>simple-testutils</artifactId>
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom
new file mode 100644
index 0000000..9d75f1d
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-weather.pom
@@ -0,0 +1,39 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonatype.mavenbook.multi</groupId>
+    <artifactId>simple-parent</artifactId>
+    <version>0.9-MNG6957-SNAPSHOT</version>
+  </parent>
+  <artifactId>simple-weather</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Multi Chapter Simple Weather API</name>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.sonatype.mavenbook.multi</groupId>
+      <artifactId>simple-testutils</artifactId>
+      <scope>test</scope>
+      <version>0.9-MNG6957-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom
new file mode 100644
index 0000000..dd8e443
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/simple-webapp.pom
@@ -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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonatype.mavenbook.multi</groupId>
+    <artifactId>simple-parent</artifactId>
+    <version>0.9-MNG6957-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>simple-webapp</artifactId>
+  <name>Multi Chapter Simple Web Application Project</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.sonatype.mavenbook.multi</groupId>
+      <artifactId>simple-weather</artifactId>
+      <version>0.9-MNG6957-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <finalName>simple-webapp</finalName>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>2.6</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom
new file mode 100644
index 0000000..934ac75
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/expected/utils-parent.pom
@@ -0,0 +1,27 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+  	<groupId>org.sonatype.mavenbook.multi</groupId>
+  	<artifactId>simple-parent</artifactId>
+  	<version>0.9-MNG6957-SNAPSHOT</version>
+  </parent>
+  <artifactId>utils-parent</artifactId>
+  <packaging>pom</packaging>
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/pom.xml b/core-it-suite/src/test/resources/mng-6957-buildconsumer/pom.xml
new file mode 100644
index 0000000..5acb793
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/pom.xml
@@ -0,0 +1,36 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.sonatype.mavenbook.multi</groupId>
+  <artifactId>parent</artifactId>
+  <version>0.9-${changelist}-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Multi Chapter Parent Project</name>
+
+  <!-- Optimized from https://github.com/sonatype/maven-example-en/tree/master/examples/ch-multi -->
+  <modules>
+    <module>simple-parent</module>
+  </modules>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/pom.xml b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/pom.xml
new file mode 100644
index 0000000..fb098e0
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/pom.xml
@@ -0,0 +1,56 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+  	<groupId>org.sonatype.mavenbook.multi</groupId>
+  	<artifactId>parent</artifactId>
+  </parent>
+  <artifactId>simple-parent</artifactId>
+  <packaging>pom</packaging>
+  <name>Multi Chapter Simple Parent Project</name>
+ 
+  <modules>
+    <module>simple-weather</module>
+    <module>simple-webapp</module>
+
+    <!-- On purpose at the end, project graph is responsible for ordering -->
+    <!-- Build/consumer should not be effected by reverse order -->
+    <module>simple-testutils</module>
+    <module>utils-parent</module>
+  </modules>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>0.1-stub-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-testutils/pom.xml b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-testutils/pom.xml
new file mode 100644
index 0000000..b9b32a4
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-testutils/pom.xml
@@ -0,0 +1,32 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonatype.mavenbook.multi</groupId>
+    <artifactId>utils-parent</artifactId>
+    <relativePath>../utils-parent</relativePath>
+  </parent>
+  <artifactId>simple-testutils</artifactId>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-weather/pom.xml b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-weather/pom.xml
new file mode 100644
index 0000000..4a1873c
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-weather/pom.xml
@@ -0,0 +1,43 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonatype.mavenbook.multi</groupId>
+    <artifactId>simple-parent</artifactId>
+  </parent>
+  <artifactId>simple-weather</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Multi Chapter Simple Weather API</name>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.sonatype.mavenbook.multi</groupId>
+      <artifactId>simple-testutils</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-webapp/pom.xml b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-webapp/pom.xml
new file mode 100644
index 0000000..9e18a21
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/simple-webapp/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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.sonatype.mavenbook.multi</groupId>
+    <artifactId>simple-parent</artifactId>
+  </parent>
+
+  <artifactId>simple-webapp</artifactId>
+  <name>Multi Chapter Simple Web Application Project</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.sonatype.mavenbook.multi</groupId>
+      <artifactId>simple-weather</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <finalName>simple-webapp</finalName>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>2.6</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/utils-parent/pom.xml b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/utils-parent/pom.xml
new file mode 100644
index 0000000..deb03d6
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6957-buildconsumer/simple-parent/utils-parent/pom.xml
@@ -0,0 +1,32 @@
+<?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 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+  	<groupId>org.sonatype.mavenbook.multi</groupId>
+  	<artifactId>simple-parent</artifactId>
+  </parent>
+  <artifactId>utils-parent</artifactId>
+  <packaging>pom</packaging>
+</project>