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 2022/05/26 15:48:57 UTC
[maven-enforcer] 01/01: [MENFORCER-408] Add new dependency convergence regression IT
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MENFORCER-408
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git
commit 07b5d6d8d8a193dea7b6da475bfb8645ede164f0
Author: Alexander Kriegisch <Al...@Kriegisch.name>
AuthorDate: Fri Dec 17 08:59:44 2021 +0700
[MENFORCER-408] Add new dependency convergence regression IT
Before @ca40308f, there was a problem which existed at least from 1.4.1
to 3.0.0-M3 and was fixed accidentally by a Maven dependency upgrade in
release 3.0.0.
This new IT shields the plugin from that old bug.
---
.../src/it/projects/MENFORCER-408/pom.xml | 110 +++++++++++++++++++++
.../src/it/projects/MENFORCER-408/verify.groovy | 26 +++++
2 files changed, 136 insertions(+)
diff --git a/maven-enforcer-plugin/src/it/projects/MENFORCER-408/pom.xml b/maven-enforcer-plugin/src/it/projects/MENFORCER-408/pom.xml
new file mode 100644
index 0000000..bc73d7d
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/MENFORCER-408/pom.xml
@@ -0,0 +1,110 @@
+<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>test</groupId>
+ <artifactId>dependency-convergence-problem</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <version.selenium>3.0.1</version.selenium>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <id>enforce-dependency-convergence</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <dependencyConvergence/>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-java</artifactId>
+ <version>${version.selenium}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-remote-driver</artifactId>
+ <version>${version.selenium}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.codeborne</groupId>
+ <artifactId>phantomjsdriver</artifactId>
+ <version>1.3.0</version>
+ <scope>test</scope>
+ <!--
+ This exclusion makes the problem go away, but it should not be necessary
+ because selenium-java is version-managed already
+ -->
+ <!--
+ <exclusions>
+ <exclusion>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-java</artifactId>
+ </exclusion>
+ </exclusions>
+ -->
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.websocket</groupId>
+ <artifactId>websocket-client</artifactId>
+ <version>9.2.18.v20160721</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-java</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/maven-enforcer-plugin/src/it/projects/MENFORCER-408/verify.groovy b/maven-enforcer-plugin/src/it/projects/MENFORCER-408/verify.groovy
new file mode 100644
index 0000000..fbf5059
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/MENFORCER-408/verify.groovy
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+File buildLog = new File( basedir, 'build.log' )
+// Actually, this assertion is not strictly necessary, because the build should pass anyway.
+// But it documents the false failure output which was present before commit @ca40308f.
+assert !buildLog.text.contains( """
++-test:dependency-convergence-problem:jar:1.0-SNAPSHOT
+ +-org.seleniumhq.selenium:selenium-java:jar:3.0.1:test
+ +-org.seleniumhq.selenium:selenium-java:jar:2.53.0:test
+""" )