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

[maven-integration-testing] branch MNG-5563 created (now 0ac2fe8)

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

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


      at 0ac2fe8  [MNG-5563] Ensuring only the available parameters are allowed

This branch includes the following new commits:

     new 0ac2fe8  [MNG-5563] Ensuring only the available parameters are allowed

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.



[maven-integration-testing] 01/01: [MNG-5563] Ensuring only the available parameters are allowed

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

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

commit 0ac2fe8496ce3134dba9ee98fa04662b586a136d
Author: rfscholte <rf...@apache.org>
AuthorDate: Sun Dec 20 16:39:59 2020 +0100

    [MNG-5563] Ensuring only the available parameters are allowed
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 .../maven/it/MavenITmng5563UnknownParameters.java  | 57 ++++++++++++++++++++++
 .../mng-5563-unknown-parameters/execution/pom.xml  | 47 ++++++++++++++++++
 3 files changed, 105 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 5c78f9a..4c4cfad 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( MavenITmng5563UnknownParameters.class );
         suite.addTestSuite( MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.class );
         suite.addTestSuite( MavenITmng6754TimestampInMultimoduleProject.class );
         suite.addTestSuite( MavenITmng6981ProjectListShouldIncludeChildrenTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5563UnknownParameters.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5563UnknownParameters.java
new file mode 100644
index 0000000..2d675e5
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5563UnknownParameters.java
@@ -0,0 +1,57 @@
+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 java.io.File;
+import java.util.Arrays;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * Warn about unknown parameters
+ */
+public class MavenITmng5563UnknownParameters
+    extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng5563UnknownParameters()
+    {
+        super( "[4.0.0-alpha-1,)" );
+    }
+
+    /**
+     * One executionblock may contain multiple goals.
+     * Ensure that the parameters exist in at least one of the goals 
+     * 
+     * @throws Exception
+     */
+    public void testPluginExecutionConfiguration()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5563-unknown-parameters/execution" );
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+
+        verifier.setMavenDebug( false );
+        verifier.setAutoclean( false );
+        verifier.executeGoals( Arrays.asList( "compile" ) );
+        verifier.verifyTextInLog( "Unknown parameters for org.apache.maven.plugins:maven-compiler-plugin:0.1-stub-SNAPSHOT (default-compile):" );
+        verifier.verifyTextInLog( "  <unknown> @ org.apache.maven.its.mng5563:mng5563-execution:0.0.1-SNAPSHOT, line 40" );
+        verifier.resetStreams();
+    }
+}
diff --git a/core-it-suite/src/test/resources/mng-5563-unknown-parameters/execution/pom.xml b/core-it-suite/src/test/resources/mng-5563-unknown-parameters/execution/pom.xml
new file mode 100644
index 0000000..d10f7b7
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5563-unknown-parameters/execution/pom.xml
@@ -0,0 +1,47 @@
+<?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.mng5563</groupId>
+  <artifactId>mng5563-execution</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>0.1-stub-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>default-compile</id>
+            <configuration>
+              <unknown>VALUE</unknown>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>