You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/01/06 15:38:59 UTC

[maven-enforcer] branch MENFORCER-268-ci-friendly updated: Added Invoker test to prove requirePluginVersions is working.

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

khmarbaise pushed a commit to branch MENFORCER-268-ci-friendly
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


The following commit(s) were added to refs/heads/MENFORCER-268-ci-friendly by this push:
     new d052c05  Added Invoker test to prove requirePluginVersions is working.
d052c05 is described below

commit d052c05292afa3bbe2c48025de202f31cebc3da8
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Jan 6 16:38:37 2018 +0100

    Added Invoker test to prove requirePluginVersions is working.
---
 .../require-plugin-versions-ci/child/pom.xml       | 33 ++++++++++++
 .../require-plugin-versions-ci/invoker.properties  | 19 +++++++
 .../it/projects/require-plugin-versions-ci/pom.xml | 63 ++++++++++++++++++++++
 .../require-plugin-versions-ci/verify.groovy       | 21 ++++++++
 4 files changed, 136 insertions(+)

diff --git a/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/child/pom.xml b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/child/pom.xml
new file mode 100644
index 0000000..40ed3e6
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/child/pom.xml
@@ -0,0 +1,33 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.enforcer</groupId>
+    <artifactId>test</artifactId>
+    <version>${revision}</version>
+  </parent>
+
+  <artifactId>child</artifactId>
+
+</project>
diff --git a/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/invoker.properties b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/invoker.properties
new file mode 100644
index 0000000..adc1614
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/invoker.properties
@@ -0,0 +1,19 @@
+# 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.maven.version = 3.5.0+
+invoker.buildResult=failure
\ No newline at end of file
diff --git a/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/pom.xml b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/pom.xml
new file mode 100644
index 0000000..dd6501f
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/pom.xml
@@ -0,0 +1,63 @@
+<?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.enforcer</groupId>
+  <artifactId>test</artifactId>
+  <version>${revision}</version>
+  <packaging>pom</packaging>
+
+  <properties>
+    <revision>1.0-SNAPSHOT</revision>
+  </properties>
+  <modules>
+    <module>child</module>
+  </modules>
+  <description>
+    This IT demonstrates the use of properties for the versions for requirePluginVersions.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requirePluginVersions>
+                </requirePluginVersions>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/verify.groovy
new file mode 100644
index 0000000..865bfeb
--- /dev/null
+++ b/maven-enforcer-plugin/src/it/projects/require-plugin-versions-ci/verify.groovy
@@ -0,0 +1,21 @@
+/*
+ * 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' )
+assert buildLog.text.contains( '[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequirePluginVersions failed with message:' )
+assert buildLog.text.contains( 'Some plugins are missing valid versions:(LATEST RELEASE SNAPSHOT are not allowed )' )

-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].