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

[maven-integration-testing] branch MNG-6772 updated (57c58d8 -> 0944753)

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

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


 discard 57c58d8  [MNG-6772] Prove Super POM central entry won't override
     add f3521b4  update ASF CI url
     new 0944753  [MNG-6772] Prove Super POM central entry won't override

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (57c58d8)
            \
             N -- N -- N   refs/heads/MNG-6772 (0944753)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../src/test/java/org/apache/maven/it/IntegrationTestSuite.java         | 2 --
 .../maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java     | 2 +-
 pom.xml                                                                 | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)


[maven-integration-testing] 01/01: [MNG-6772] Prove Super POM central entry won't override

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

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

commit 0944753d99d058d2a2e0c097fe7e9b4ee41d387a
Author: Eddie Wiegers <eg...@mst.edu>
AuthorDate: Thu Oct 3 14:28:11 2019 -0500

    [MNG-6772] Prove Super POM central entry won't override
    
    Closes #49
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 ...mng6772NestedImportScopeRepositoryOverride.java | 95 ++++++++++++++++++++++
 .../pom-template.xml                               | 50 ++++++++++++
 .../org/apache/maven/its/mng6772/a/0.1/a-0.1.pom   | 41 ++++++++++
 .../org/apache/maven/its/mng6772/b/0.1/b-0.1.pom   | 39 +++++++++
 .../its/mng6772/dependency/0.1/dependency-0.1.pom  | 41 ++++++++++
 .../settings-override.xml                          | 23 ++++++
 .../mng-6772-override-in-project/pom-template.xml  | 53 ++++++++++++
 .../org/apache/maven/its/mng6772/a/0.1/a-0.1.pom   | 41 ++++++++++
 .../org/apache/maven/its/mng6772/b/0.1/b-0.1.pom   | 39 +++++++++
 .../settings-override.xml                          | 23 ++++++
 11 files changed, 446 insertions(+)

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 ee41a83..c717aca 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
@@ -108,6 +108,7 @@ public class IntegrationTestSuite
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
         suite.addTestSuite( MavenITmng6972AllowAccessToGraphPackageTest.class );
+        suite.addTestSuite( MavenITmng6772NestedImportScopeRepositoryOverride.class );
         suite.addTestSuite( MavenITmng6759TransitiveDependencyRepositoriesTest.class );
         suite.addTestSuite( MavenITmng6720FailFastTest.class );
         suite.addTestSuite( MavenITmng6656BuildConsumer.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java
new file mode 100644
index 0000000..636327d
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+
+/*
+ * 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;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-6772">MNG-6772</a>:
+ *
+ * The test POM references an import scope POM, which also has a dependency on an import scope POM.
+ *
+ * Both import POMs can only be found in the repository defined in the test POM. 
+ * It has a parent POM that defines the same repository with a different location.
+ * The test confirms that the dominant repository definition (child) wins while resolving the import POMs.
+ *
+ */
+public class MavenITmng6772NestedImportScopeRepositoryOverride
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng6772NestedImportScopeRepositoryOverride()
+    {
+        super( "[3.7.0,)" );
+    }
+
+    // This will test the behavior using ProjectModelResolver
+    public void testitInProject()
+        throws Exception
+    {
+        final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6772-override-in-project" );
+
+        final Verifier verifier = newVerifier( testDir.getAbsolutePath(), null );
+        overrideGlobalSettings( testDir, verifier );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng6772" );
+
+        verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+    }
+    
+    // This will test the behavior using DefaultModelResolver
+    public void testitInDependency()
+        throws Exception
+    {
+        final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6772-override-in-dependency" );
+
+        final Verifier verifier = newVerifier( testDir.getAbsolutePath(), null );
+        overrideGlobalSettings( testDir, verifier );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng6772" );
+
+        verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+
+        verifier.executeGoal( "compile" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+    }
+    
+    // central must not be defined in any settings.xml or super POM will never be in play.
+    private void overrideGlobalSettings( final File testDir, final Verifier verifier )
+    {
+        final File settingsFile = new File( testDir, "settings-override.xml" );
+        final String path = settingsFile.getAbsolutePath();
+        verifier.getCliOptions().add( "--global-settings" );
+        if ( path.indexOf( ' ' ) < 0 )
+        {
+            verifier.getCliOptions().add( path );
+        }
+        else
+        {
+            verifier.getCliOptions().add( '"' + path + '"' );
+        }
+    }
+
+}
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-dependency/pom-template.xml b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/pom-template.xml
new file mode 100644
index 0000000..9120768
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/pom-template.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>
+
+    <groupId>org.apache.maven.its.mng6772</groupId>
+    <artifactId>test</artifactId>
+    <version>0.1</version>
+    <packaging>jar</packaging>
+
+    <name>Maven Integration Test :: MNG-6772</name>
+    <description>
+        Checks that overriding the central repository always wins over the super POM.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven.its.mng6772</groupId>
+            <artifactId>dependency</artifactId>
+            <version>0.1</version>
+            <type>pom</type>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>central</id>
+            <url>@baseurl@/repo</url>
+        </repository>
+    </repositories>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/a/0.1/a-0.1.pom b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/a/0.1/a-0.1.pom
new file mode 100644
index 0000000..5420f7b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/a/0.1/a-0.1.pom
@@ -0,0 +1,41 @@
+<?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.mng6772</groupId>
+    <artifactId>a</artifactId>
+    <version>0.1</version>
+    <packaging>pom</packaging>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.maven.its.mng6772</groupId>
+                <artifactId>b</artifactId>
+                <version>0.1</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/b/0.1/b-0.1.pom b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/b/0.1/b-0.1.pom
new file mode 100644
index 0000000..5cc3486
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/b/0.1/b-0.1.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>
+    <modelVersion>4.0.0</modelVersion>
+    
+    <groupId>org.apache.maven.its.mng6772</groupId>
+    <artifactId>b</artifactId>
+    <version>0.1</version>
+    <packaging>pom</packaging>
+    
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.maven.its.mng6772</groupId>
+                <artifactId>c</artifactId>
+                <version>0.1</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/dependency/0.1/dependency-0.1.pom b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/dependency/0.1/dependency-0.1.pom
new file mode 100644
index 0000000..5a6b1e1
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/repo/org/apache/maven/its/mng6772/dependency/0.1/dependency-0.1.pom
@@ -0,0 +1,41 @@
+<?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.mng6772</groupId>
+    <artifactId>dependency</artifactId>
+    <version>0.1</version>
+    <packaging>pom</packaging>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.maven.its.mng6772</groupId>
+                <artifactId>a</artifactId>
+                <version>0.1</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-dependency/settings-override.xml b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/settings-override.xml
new file mode 100644
index 0000000..662d3f0
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-dependency/settings-override.xml
@@ -0,0 +1,23 @@
+<?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.
+-->
+
+<settings>
+</settings>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-project/pom-template.xml b/core-it-suite/src/test/resources/mng-6772-override-in-project/pom-template.xml
new file mode 100644
index 0000000..19149cd
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-project/pom-template.xml
@@ -0,0 +1,53 @@
+<?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.mng6772</groupId>
+    <artifactId>test</artifactId>
+    <version>0.1</version>
+    <packaging>jar</packaging>
+
+    <name>Maven Integration Test :: MNG-6772</name>
+    <description>
+        Checks that overriding the central repository always wins over the super POM.
+    </description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.maven.its.mng6772</groupId>
+                <artifactId>a</artifactId>
+                <version>0.1</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <repositories>
+        <repository>
+            <id>central</id>
+            <url>@baseurl@/repo</url>
+        </repository>
+    </repositories>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-project/repo/org/apache/maven/its/mng6772/a/0.1/a-0.1.pom b/core-it-suite/src/test/resources/mng-6772-override-in-project/repo/org/apache/maven/its/mng6772/a/0.1/a-0.1.pom
new file mode 100644
index 0000000..5420f7b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-project/repo/org/apache/maven/its/mng6772/a/0.1/a-0.1.pom
@@ -0,0 +1,41 @@
+<?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.mng6772</groupId>
+    <artifactId>a</artifactId>
+    <version>0.1</version>
+    <packaging>pom</packaging>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.maven.its.mng6772</groupId>
+                <artifactId>b</artifactId>
+                <version>0.1</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-project/repo/org/apache/maven/its/mng6772/b/0.1/b-0.1.pom b/core-it-suite/src/test/resources/mng-6772-override-in-project/repo/org/apache/maven/its/mng6772/b/0.1/b-0.1.pom
new file mode 100644
index 0000000..5cc3486
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-project/repo/org/apache/maven/its/mng6772/b/0.1/b-0.1.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>
+    <modelVersion>4.0.0</modelVersion>
+    
+    <groupId>org.apache.maven.its.mng6772</groupId>
+    <artifactId>b</artifactId>
+    <version>0.1</version>
+    <packaging>pom</packaging>
+    
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.maven.its.mng6772</groupId>
+                <artifactId>c</artifactId>
+                <version>0.1</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6772-override-in-project/settings-override.xml b/core-it-suite/src/test/resources/mng-6772-override-in-project/settings-override.xml
new file mode 100644
index 0000000..662d3f0
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6772-override-in-project/settings-override.xml
@@ -0,0 +1,23 @@
+<?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.
+-->
+
+<settings>
+</settings>