[maven-enforcer] branch master updated: [MENFORCER-192] Rule RequireSameVersions: dependency artifacts are not checked Added IT to verify this is no longer an issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[maven-enforcer] branch master updated: [MENFORCER-192] Rule RequireSameVersions: dependency artifacts are not checked Added IT to verify this is no longer an issue

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

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


The following commit(s) were added to refs/heads/master by this push:
     new 4ff8bf4  [MENFORCER-192] Rule RequireSameVersions: dependency artifacts are not checked Added IT to verify this is no longer an issue
4ff8bf4 is described below

commit 4ff8bf4de1893b3de8166c48c57ae5363ba11eda
Author: Tim <[hidden email]>
AuthorDate: Sat Aug 1 13:55:13 2020 +0200

    [MENFORCER-192] Rule RequireSameVersions: dependency artifacts are not checked
    Added IT to verify this is no longer an issue
   
    Signed-off-by: rfscholte <[hidden email]>
---
 .../src/it/mrm/repository/menforcer192_a-1.0.pom   | 26 +++++++
 .../src/it/mrm/repository/menforcer192_a-2.0.pom   | 26 +++++++
 .../src/it/mrm/repository/menforcer192_b-1.0.pom   | 26 +++++++
 .../src/it/mrm/repository/menforcer192_c-1.0.pom   | 34 ++++++++
 .../src/it/mrm/repository/menforcer192_c-2.0.pom   | 34 ++++++++
 .../invoker.properties                             | 18 +++++
 .../pom.xml                                        | 90 ++++++++++++++++++++++
 .../pom.xml                                        | 90 ++++++++++++++++++++++
 8 files changed, 344 insertions(+)

diff --git a/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_a-1.0.pom b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_a-1.0.pom
new file mode 100644
index 0000000..d184efe
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_a-1.0.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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+    <artifactId>menforcer192-a</artifactId>
+    <version>1.0</version>
+</project>
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_a-2.0.pom b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_a-2.0.pom
new file mode 100644
index 0000000..6fc8dc6
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_a-2.0.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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+    <artifactId>menforcer192-a</artifactId>
+    <version>2.0</version>
+</project>
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_b-1.0.pom b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_b-1.0.pom
new file mode 100644
index 0000000..d5945a9
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_b-1.0.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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+    <artifactId>menforcer192-b</artifactId>
+    <version>1.0</version>
+</project>
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_c-1.0.pom b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_c-1.0.pom
new file mode 100644
index 0000000..8d558cd
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_c-1.0.pom
@@ -0,0 +1,34 @@
+<?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>org.apache.maven.plugins.enforcer.its</groupId>
+    <artifactId>menforcer192-c</artifactId>
+    <version>1.0</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+            <artifactId>menforcer192-a</artifactId>
+            <version>1.0</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_c-2.0.pom b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_c-2.0.pom
new file mode 100644
index 0000000..1748574
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/mrm/repository/menforcer192_c-2.0.pom
@@ -0,0 +1,34 @@
+<?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>org.apache.maven.plugins.enforcer.its</groupId>
+    <artifactId>menforcer192-c</artifactId>
+    <version>2.0</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+            <artifactId>menforcer192-a</artifactId>
+            <version>2.0</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-failure/invoker.properties b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-failure/invoker.properties
new file mode 100644
index 0000000..c98ac4c
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-failure/invoker.properties
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.buildResult=failure
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-failure/pom.xml b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-failure/pom.xml
new file mode 100644
index 0000000..7550644
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-failure/pom.xml
@@ -0,0 +1,90 @@
+<?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>org.apache.maven.enforcer.its</groupId>
+  <artifactId>requireSameVersion</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>enforce</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <!-- almost the rule configuration -->
+                <requireSameVersions>
+                  <dependencies>
+                    <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-a</dependency>
+                    <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-b</dependency>
+                  </dependencies>
+                </requireSameVersions>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.14</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>2.14</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+      <artifactId>menforcer192-b</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+      <artifactId>menforcer192-c</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+        <version>2.14</version>
+      </plugin>
+    </plugins>
+  </reporting>
+
+ </project>
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-success/pom.xml b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-success/pom.xml
new file mode 100644
index 0000000..67e18a4
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-same-versions_with-dependencies-success/pom.xml
@@ -0,0 +1,90 @@
+<?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>org.apache.maven.enforcer.its</groupId>
+  <artifactId>requireSameVersion</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>enforce</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <!-- almost the rule configuration -->
+                <requireSameVersions>
+                  <dependencies>
+                    <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-a</dependency>
+                    <dependency>org.apache.maven.plugins.enforcer.its:menforcer192-b</dependency>
+                  </dependencies>
+                </requireSameVersions>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.14</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>2.14</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+      <artifactId>menforcer192-b</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugins.enforcer.its</groupId>
+      <artifactId>menforcer192-c</artifactId>
+      <version>1.0</version>
+    </dependency>
+  </dependencies>
+  
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+        <version>2.14</version>
+      </plugin>
+    </plugins>
+  </reporting>
+
+ </project>
\ No newline at end of file