You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2020/04/21 20:35:15 UTC

[maven-integration-testing] branch MNG-5001 updated (b4fae25 -> 481bb3b)

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

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


 discard b4fae25  [MNG-5001] check build failure on configure read-only plugin parameter
     new 481bb3b  [MNG-5001] check build failure on configure read-only plugin parameter

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   (b4fae25)
            \
             N -- N -- N   refs/heads/MNG-5001 (481bb3b)

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:
 .../org/apache/maven/it/MavenITmng5001PluginReadOnlyParameter.java    | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


[maven-integration-testing] 01/01: [MNG-5001] check build failure on configure read-only plugin parameter

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

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

commit 481bb3b5c91f2400b75c977749a7a1f6b3d81856
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Wed Mar 18 03:54:27 2020 +0100

    [MNG-5001] check build failure on configure read-only plugin parameter
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 .../it/MavenITmng5001PluginReadOnlyParameter.java  | 62 +++++++++++++++++++++
 .../src/test/resources/mng-5001_readonly/pom.xml   | 63 ++++++++++++++++++++++
 3 files changed, 126 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 87b948e..9c54f3e 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
@@ -107,6 +107,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5001PluginReadOnlyParameter.class );
         suite.addTestSuite( MavenITmng5669ReadPomsOnce.class );
         suite.addTestSuite( MavenITmng6071GetResourceWithCustomPom.class );
         suite.addTestSuite( MavenITmng6759TransitiveDependencyRepositoriesTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5001PluginReadOnlyParameter.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5001PluginReadOnlyParameter.java
new file mode 100644
index 0000000..dbfa19f
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5001PluginReadOnlyParameter.java
@@ -0,0 +1,62 @@
+package org.apache.maven.it;
+
+/*
+ * 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;
+
+import java.io.File;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-5001">MNG-5001</a>:
+ * fail build if a configuring a read-only plugin parameter.
+ */
+public class MavenITmng5001PluginReadOnlyParameter
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5001PluginReadOnlyParameter()
+    {
+        super( "[2.0.5,3.0-alpha-1),[3.7.0,)" );
+    }
+
+    /**
+     * Verify that a project configuring a read-only plugin parameter just fails at build time.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5001_readonly" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        try
+        {
+            verifier.executeGoal( "validate" );
+            throw new Exception( "configuring a plugin's read-only parameter should fail" );
+        }
+        catch ( VerificationException ve )
+        {
+            // expected failure
+        }
+        verifier.resetStreams();
+    }
+
+}
diff --git a/core-it-suite/src/test/resources/mng-5001_readonly/pom.xml b/core-it-suite/src/test/resources/mng-5001_readonly/pom.xml
new file mode 100644
index 0000000..994ac0e
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5001_readonly/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 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.its.mng5001</groupId>
+  <artifactId>readonlytest</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <description>
+    IT for MNG-5001: tries to configure a read-only plugin parameter.
+    This fails with Maven 2 as expected, but is not checked with Maven 3 (up to 3.6.x) then implicitely permitted...
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-configuration</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <propertiesFile>target/config.properties</propertiesFile>
+          <basedir>target</basedir><!-- read-only parameter: configuring should not be permitted -->
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+ </project>