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/04/06 18:16:44 UTC

[maven-integration-testing] branch MNG-6656 updated: [MNG-6656] Verify installed poms

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

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


The following commit(s) were added to refs/heads/MNG-6656 by this push:
     new a2dcebb  [MNG-6656] Verify installed poms
a2dcebb is described below

commit a2dcebb8615dc0f98a64e0660931b62eafbc17f0
Author: rfscholte <rf...@apache.org>
AuthorDate: Mon Apr 6 20:16:32 2020 +0200

    [MNG-6656] Verify installed poms
---
 .../maven/it/MavenITmng6656BuildConsumer.java      | 33 +++++++++++++++++--
 .../mng-6656-buildconsumer/expected/parent.pom     | 26 +++++++++++++++
 .../pom.xml => expected/simple-parent.pom}         | 30 +++---------------
 .../expected/simple-weather.pom                    | 30 ++++++++++++++++++
 .../pom.xml => expected/simple-webapp.pom}         | 37 ++++++++--------------
 .../mng-6656-buildconsumer/simple-parent/pom.xml   | 12 -------
 .../simple-parent/simple-weather/pom.xml           | 28 ----------------
 .../simple-parent/simple-webapp/pom.xml            | 22 ++++++-------
 8 files changed, 115 insertions(+), 103 deletions(-)

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
index 08ded29..13306c1 100644
--- 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
@@ -20,6 +20,7 @@ package org.apache.maven.it;
  */
 
 import org.apache.maven.it.util.ResourceExtractor;
+import org.apache.maven.shared.utils.io.FileUtils;
 
 import java.io.File;
 import java.util.Arrays;
@@ -60,9 +61,37 @@ public class MavenITmng6656BuildConsumer
         verifier.setAutoclean( false );
         verifier.addCliOption( "-Dchangelist=JIRA101" );
 
-        // install is useless in this IT suite as it doesn't write the pomfile to the local repo
         verifier.executeGoals( Arrays.asList( "validate" ) );
-        
         verifier.verifyErrorFreeLog();
     }
+    
+    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();
+
+        // use original resource files to ensure correct EOLs
+        File resourcesDir = new File( "src/test/resources/mng-6656-buildconsumer" );
+        String content;
+        content = FileUtils.fileRead( new File( resourcesDir, "expected/parent.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6656-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( resourcesDir, "expected/simple-parent.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6656-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( resourcesDir, "expected/simple-weather.pom") ); 
+        verifier.assertArtifactContents( "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6656-SNAPSHOT", "pom", content );
+
+        content = FileUtils.fileRead( new File( resourcesDir, "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..5d81426
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/parent.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/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>
+  
+</project>
\ No newline at end of file
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/expected/simple-parent.pom
similarity index 64%
copy from core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/pom.xml
copy to core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom
index d31620a..ecef8df 100644
--- a/core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/pom.xml
+++ b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom
@@ -1,6 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
+<?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
@@ -17,24 +15,18 @@ software distributed under the License is distributed on an
 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">
+--><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>
  
-  <modules>
-    <module>simple-weather</module>
-    <module>simple-webapp</module>
-  </modules>
+  
 
   <build>
     <pluginManagement>
@@ -42,21 +34,9 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
-          <configuration>
-            <source>1.8</source>
-            <target>1.8</target>
-          </configuration>
         </plugin>
       </plugins>
     </pluginManagement>
   </build>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>
+</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/simple-parent/simple-webapp/pom.xml b/core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom
similarity index 63%
copy from core-it-suite/src/test/resources/mng-6656-buildconsumer/simple-parent/simple-webapp/pom.xml
copy to core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-webapp.pom
index b3be6ed..0528770 100644
--- 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/expected/simple-webapp.pom
@@ -1,6 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
+<?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
@@ -17,39 +15,32 @@ software distributed under the License is distributed on an
 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">
+--><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>
-  <packaging>war</packaging>
   <name>Multi Chapter Simple Web Application Project</name>
   <dependencies>
     <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-servlet_2.4_spec</artifactId>
-      <version>1.1.1</version>
-    </dependency>
-    <dependency>
       <groupId>org.sonatype.mavenbook.multi</groupId>
       <artifactId>simple-weather</artifactId>
-    </dependency>
+    <version>0.9-MNG6656-SNAPSHOT</version></dependency>
   </dependencies>
   <build>
     <finalName>simple-webapp</finalName>
-    <plugins>
-      <plugin>
-        <groupId>org.mortbay.jetty</groupId>
-        <artifactId>maven-jetty-plugin</artifactId>
-        <version>6.1.9</version>
-      </plugin>
-    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>2.6</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
-</project>
+</project>
\ No newline at end of file
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
index d31620a..f162121 100644
--- 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
@@ -42,21 +42,9 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
-          <configuration>
-            <source>1.8</source>
-            <target>1.8</target>
-          </configuration>
         </plugin>
       </plugins>
     </pluginManagement>
   </build>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
 </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
index 165a245..08baf8e 100644
--- 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
@@ -32,32 +32,4 @@ under the License.
 
   <name>Multi Chapter Simple Weather API</name>
 
-  <dependencies>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>1.2.14</version>
-    </dependency>
-    <dependency>
-      <groupId>dom4j</groupId>
-      <artifactId>dom4j</artifactId>
-      <version>1.6.1</version>
-    </dependency>
-    <dependency>
-      <groupId>jaxen</groupId>
-      <artifactId>jaxen</artifactId>
-      <version>1.1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>velocity</groupId>
-      <artifactId>velocity</artifactId>
-      <version>1.5</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>1.3.2</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
 </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
index b3be6ed..9e9c087 100644
--- 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
@@ -29,27 +29,23 @@ under the License.
   </parent>
 
   <artifactId>simple-webapp</artifactId>
-  <packaging>war</packaging>
   <name>Multi Chapter Simple Web Application Project</name>
   <dependencies>
     <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-servlet_2.4_spec</artifactId>
-      <version>1.1.1</version>
-    </dependency>
-    <dependency>
       <groupId>org.sonatype.mavenbook.multi</groupId>
       <artifactId>simple-weather</artifactId>
     </dependency>
   </dependencies>
   <build>
     <finalName>simple-webapp</finalName>
-    <plugins>
-      <plugin>
-        <groupId>org.mortbay.jetty</groupId>
-        <artifactId>maven-jetty-plugin</artifactId>
-        <version>6.1.9</version>
-      </plugin>
-    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>2.6</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
 </project>