You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2020/11/14 00:11:58 UTC

[maven-integration-testing] branch master updated: Move test plugin for MNG-4338 to Maven 3.0 Plugin API

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

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


The following commit(s) were added to refs/heads/master by this push:
     new bb6f3f3  Move test plugin for MNG-4338 to Maven 3.0 Plugin API
bb6f3f3 is described below

commit bb6f3f347ccf080313f030d99956102183444ec1
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Nov 14 00:16:58 2020 +0100

    Move test plugin for MNG-4338 to Maven 3.0 Plugin API
---
 .../org/apache/maven/it/MavenITmng4338OptionalMojosTest.java   |  4 ++--
 .../core-it-plugins/maven-it-plugin-optional-mojos/pom.xml     |  7 ++++++-
 .../main/java/org/apache/maven/plugin/coreit/TouchMojo.java    | 10 ++++------
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java
index 0128b8d..4d931b4 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java
@@ -26,7 +26,7 @@ import java.io.File;
 
 /**
  * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4338">MNG-4338</a>.
- * 
+ *
  * @author Benjamin Bentmann
  */
 public class MavenITmng4338OptionalMojosTest
@@ -35,7 +35,7 @@ public class MavenITmng4338OptionalMojosTest
 
     public MavenITmng4338OptionalMojosTest()
     {
-        super( ALL_MAVEN_VERSIONS );
+        super( "[3.0,)" );
     }
 
     /**
diff --git a/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/pom.xml b/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/pom.xml
index c55a410..71be064 100644
--- a/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/pom.xml
+++ b/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/pom.xml
@@ -45,7 +45,12 @@ under the License.
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
+      <version>3.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <!--
diff --git a/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java b/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
index 0dc49ea..96559ce 100644
--- a/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
+++ b/core-it-support/core-it-plugins/maven-it-plugin-optional-mojos/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
@@ -21,23 +21,21 @@ package org.apache.maven.plugin.coreit;
 
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 
 import java.io.File;
 import java.io.IOException;
 
 /**
  * Creates an empty file to prove this goal was executed.
- * 
- *
- * @goal touch
  */
+@Mojo( name = "touch" )
 public class TouchMojo
     extends AbstractMojo
 {
 
-    /**
-     * @parameter default-value="${project.build.directory}/touch.txt"
-     */
+    @Parameter( defaultValue = "${project.build.directory}/touch.txt" )
     private File touchFile;
 
     public void execute()