[MNG-6656] Support build/consumer process
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 2a475fc..67a2c8e 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
@@ -107,6 +107,7 @@
// -------------------------------------------------------------------------------------------------------------
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+ suite.addTestSuite( MavenITmng6656BuildConsumer.class );
suite.addTestSuite( MavenITmng6562WarnDefaultBindings.class );
suite.addTestSuite( MavenITmng5868NoDuplicateAttachedArtifacts.class );
suite.addTestSuite( MavenITmng5937MavenWrapper.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java
index c5da6f9..9051a42 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java
@@ -51,6 +51,7 @@
protected void tearDown()
throws Exception
{
+
super.tearDown();
}
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java
index 2af88bf..68adbae 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java
@@ -62,6 +62,8 @@
verifier.verifyErrorFreeLog();
// run custom "test-only" build phase
+ verifier.setForkJvm( true );
+ verifier.setMavenDebug( true );
verifier.executeGoal( "test-only" );
verifier.resetStreams();
verifier.verifyErrorFreeLog();
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 c2835f9..666b647 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
@@ -45,7 +45,7 @@
super( "[3.7.0,)" );
}
- public void testit()
+ public void testWithoutBuildConsumer()
throws Exception
{
// prepare JavaAgent
@@ -61,11 +61,12 @@
verifier.setAutoclean( false );
verifier.addCliOption( "-q" );
verifier.addCliOption( "-U" );
+ verifier.addCliOption( "-Dmaven.experimental.buildconsumer=false" );
verifier.executeGoals( Arrays.asList( "verify" ) );
verifier.resetStreams();
-
+
List<String> logTxt = verifier.loadLines( "log.txt", "utf-8" );
- for ( String line : logTxt )
+ for ( String line : logTxt )
{
if ( line.startsWith( "Picked up JAVA_TOOL_OPTIONS:" ) )
{
@@ -74,21 +75,21 @@
}
}
assertEquals( logTxt.toString(), 168, logTxt.size() );
-
+
// analyze lines. It is a Hashmap, so we can't rely on the order
Set<String> uniqueBuildingSources = new HashSet<>( 168 );
final String buildSourceKey = "org.apache.maven.model.building.source=";
final int keyLength = buildSourceKey.length();
- for( String line : logTxt )
+ for ( String line : logTxt )
{
int start = line.indexOf( buildSourceKey );
if ( start < 0 )
{
continue;
}
-
- int end = line.indexOf(", ", start);
- if ( end < 0)
+
+ int end = line.indexOf( ", ", start );
+ if ( end < 0 )
{
end = line.length() - 1; // is the }
}
@@ -96,4 +97,59 @@
}
assertEquals( uniqueBuildingSources.size(), 167 /* is 168 minus superpom */ );
}
+
+ public void testWithBuildConsumer()
+ throws Exception
+ {
+ // prepare JavaAgent
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5669-read-poms-once" );
+ Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
+ Map<String, String> filterProperties =
+ Collections.singletonMap( "${javaAgentJar}",
+ verifier.getArtifactPath( "mng-coreit", "javaagent", "1.0-SNAPSHOT", "jar" ) );
+ verifier.filterFile( ".mvn/jvm.config", ".mvn/jvm.config", null, filterProperties );
+
+ verifier.setForkJvm( true ); // pick up agent
+ verifier.setMavenDebug( false );
+ verifier.setAutoclean( false );
+ verifier.addCliOption( "-q" );
+ verifier.addCliOption( "-U" );
+ verifier.addCliOption( "-Dmaven.experimental.buildconsumer=true" );
+ verifier.executeGoals( Arrays.asList( "verify" ) );
+ verifier.resetStreams();
+
+ List<String> logTxt = verifier.loadLines( "log.txt", "utf-8" );
+ for ( String line : logTxt )
+ {
+ if ( line.startsWith( "Picked up JAVA_TOOL_OPTIONS:" ) )
+ {
+ logTxt.remove( line );
+ break;
+ }
+ }
+ assertEquals( logTxt.toString(), 168 + 4 /* reactor poms are read twice: file + raw (=XMLFilters) */,
+ logTxt.size() );
+
+ // analyze lines. It is a Hashmap, so we can't rely on the order
+ Set<String> uniqueBuildingSources = new HashSet<>( 168 );
+ final String buildSourceKey = "org.apache.maven.model.building.source=";
+ final int keyLength = buildSourceKey.length();
+ for ( String line : logTxt )
+ {
+ int start = line.indexOf( buildSourceKey );
+ if ( start < 0 )
+ {
+ continue;
+ }
+
+ int end = line.indexOf( ", ", start );
+ if ( end < 0 )
+ {
+ end = line.length() - 1; // is the }
+ }
+ uniqueBuildingSources.add( line.substring( start + keyLength, end ) );
+ }
+ assertEquals( uniqueBuildingSources.size(), 167 /* is 168 minus superpom */ );
+ }
+
}
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java
new file mode 100644
index 0000000..b39ac57
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java
@@ -0,0 +1,91 @@
+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.xml will be adjusted during the process.
+ * <ul>
+ * <li>CLI-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 MavenITmng6656BuildConsumer
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng6656BuildConsumer()
+ {
+ super( "[3.7.0,)" );
+ }
+
+ /**
+ * 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-6656-buildconsumer" );
+
+ Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
+ verifier.setMavenDebug( false );
+ verifier.setAutoclean( false );
+ verifier.addCliOption( "-Dchangelist=MNG6656" );
+
+ 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-MNG6656-SNAPSHOT", "pom", content );
+
+ content = FileUtils.fileRead( new File( testDir, "expected/simple-parent.pom") );
+ verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6656-SNAPSHOT", "pom", content );
+
+ content = FileUtils.fileRead( new File( testDir, "expected/simple-weather.pom") );
+ verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6656-SNAPSHOT", "pom", content );
+
+ content = FileUtils.fileRead( new File( testDir, "expected/simple-webapp.pom") );
+ verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6656-SNAPSHOT", "pom", content );
+ }
+
+}
diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.pom
new file mode 100644
index 0000000..53a7d3d
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.sonatype.mavenbook.multi</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.9-MNG6656-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-6656-buildconsumer/expected/simple-parent.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom
new file mode 100644
index 0000000..ecef8df
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom
@@ -0,0 +1,42 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.sonatype.mavenbook.multi</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.9-MNG6656-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-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom
new file mode 100644
index 0000000..10570e3
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-weather.pom
@@ -0,0 +1,30 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.sonatype.mavenbook.multi</groupId>
+ <artifactId>simple-parent</artifactId>
+ <version>0.9-MNG6656-SNAPSHOT</version>
+ </parent>
+ <artifactId>simple-weather</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Multi Chapter Simple Weather API</name>
+
+</project>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom
new file mode 100644
index 0000000..7371207
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.sonatype.mavenbook.multi</groupId>
+ <artifactId>simple-parent</artifactId>
+ <version>0.9-MNG6656-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-MNG6656-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-6656-buildconsumer/pom.xml b/core-it-suite/src/test/resources/mng-6656-buildconsumer/pom.xml
new file mode 100644
index 0000000..1455523
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-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/maven-v4_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-6656-buildconsumer/simple-parent/pom.xml b/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/pom.xml
new file mode 100644
index 0000000..f162121
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/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 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/maven-v4_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>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/simple-weather/pom.xml b/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/simple-weather/pom.xml
new file mode 100644
index 0000000..08baf8e
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/simple-weather/pom.xml
@@ -0,0 +1,35 @@
+<?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/maven-v4_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>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/simple-webapp/pom.xml b/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/simple-webapp/pom.xml
new file mode 100644
index 0000000..9e9c087
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-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/maven-v4_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>