You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/06 20:21:02 UTC

[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #184: Modernize IT plugins to use annotations

slawekjaranowski commented on code in PR #184:
URL: https://github.com/apache/maven-integration-testing/pull/184#discussion_r989426423


##########
core-it-suite/src/test/resources/mng-5663-nested-import-scope-pom-resolution/pom-template.xml:
##########
@@ -65,7 +65,7 @@ under the License.
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-resources-plugin</artifactId>
-                    <version>2.6</version>
+                    <version>3.2.0</version>

Review Comment:
   3.3.0



##########
core-it-suite/src/test/resources/mng-5663-nested-import-scope-pom-resolution/pom-template.xml:
##########
@@ -75,7 +75,7 @@ under the License.
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-jar-plugin</artifactId>
-                    <version>2.2</version>
+                    <version>3.2.2</version>

Review Comment:
   3.3.0 ?



##########
core-it-suite/src/test/resources/mng-5576-cd-friendly-versions/pom.xml:
##########
@@ -70,12 +70,12 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-install-plugin</artifactId>
-          <version>2.5.2</version>
+          <version>3.0.0-M1</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-deploy-plugin</artifactId>
-          <version>2.8.2</version>
+          <version>3.0.0-M2</version>

Review Comment:
   3.0.0 ?



##########
core-it-suite/src/test/resources/mng-5576-cd-friendly-versions/pom.xml:
##########
@@ -70,12 +70,12 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-install-plugin</artifactId>
-          <version>2.5.2</version>
+          <version>3.0.0-M1</version>

Review Comment:
   3.0.1 ?



##########
core-it-suite/src/test/resources/mng-5663-nested-import-scope-pom-resolution/pom-template.xml:
##########
@@ -85,7 +85,7 @@ under the License.
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-install-plugin</artifactId>
-                    <version>2.5.2</version>
+                    <version>3.0.0-M1</version>

Review Comment:
   3.0.1 ?



##########
core-it-suite/src/test/resources/mng-5868/pom.xml:
##########
@@ -33,6 +33,11 @@
             <artifactClassifier>run</artifactClassifier>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-deploy-plugin</artifactId>
+          <version>3.0.0-M2</version>

Review Comment:
   3.3.0 ?



##########
core-it-suite/src/test/resources/mng-5669-read-poms-once/pom.xml:
##########
@@ -49,12 +49,12 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>3.0.0-M5</version>
+          <version>3.0.0-M7</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
-          <version>3.2.0</version>
+          <version>3.2.2</version>

Review Comment:
   3.3.0 ?



##########
core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml:
##########
@@ -37,17 +37,17 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-assembly-plugin</artifactId>
-          <version>3.1.0</version>
+          <version>3.4.0</version>

Review Comment:
   3.4.2 ?



##########
core-it-suite/src/test/resources/mng-7349-relocation-warning/artifacts/pom.xml:
##########
@@ -11,7 +11,7 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <maven.compiler.source>1.7</maven.compiler.source>
     <maven.compiler.target>1.7</maven.compiler.target>

Review Comment:
   1.8 ?



##########
core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml:
##########
@@ -37,17 +37,17 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-assembly-plugin</artifactId>
-          <version>3.1.0</version>
+          <version>3.4.0</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
-          <version>2.2</version>
+          <version>3.2.2</version>

Review Comment:
   3.3.0 ?



##########
core-it-support/core-it-plugins/maven-it-plugin-active-collection/pom.xml:
##########
@@ -45,12 +45,18 @@ under the License.
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
       <version>2.0</version>

Review Comment:
   to remove ?



##########
core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkGoalAggregatorMojo.java:
##########
@@ -21,34 +21,36 @@
 
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Execute;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 
 import java.util.List;
 
 /**
- * @goal fork-goal-aggregator
- * @aggregator true
- * @execute goal="touch"
  */
+@Mojo( name = "fork-goal-aggregator", aggregator = true )
+@Execute( goal = "touch" )
 public class ForkGoalAggregatorMojo
     extends AbstractMojo
 {
     /**
-     * @parameter default-value="${project}"
      */
+    @Parameter( defaultValue = "${project}" )
     private MavenProject project;
 
     /**
-     * @parameter default-value="${reactorProjects}"
      */
-    private List reactorProjects;
+    @Parameter( defaultValue = "${reactorProjects}" )
+    private List<MavenProject> reactorProjects;
 
     public void execute()
         throws MojoExecutionException
     {
-        for ( Object reactorProject : reactorProjects )
+        for ( MavenProject reactorProject : reactorProjects )
         {
-            MavenProject executedProject = ( (MavenProject) reactorProject ).getExecutionProject();
+            MavenProject executedProject = ( reactorProject ).getExecutionProject();

Review Comment:
   parentheses not needed



##########
core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckMojo.java:
##########
@@ -35,42 +38,35 @@
 /**
  * Checks the general retrieval of components from active component collections.
  *
- * @goal check
- * @phase validate
- *
  * @author Benjamin Bentmann
  */
+@Mojo( name = "check", defaultPhase = LifecyclePhase.VALIDATE )
 public class CheckMojo
     extends AbstractMojo
 {
 
     /**
      * Project base directory used for manual path alignment.
-     *
-     * @parameter default-value="${basedir}"
-     * @readonly
      */
+    @Parameter( defaultValue = "${basedir}", readonly = true )
     private File basedir;
 
     /**
      * The available components, as a map.
-     *
-     * @component role="org.apache.maven.plugin.coreit.Component"
      */
-    private Map componentMap;
+    @org.apache.maven.plugins.annotations.Component

Review Comment:
   please add import



##########
core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java:
##########
@@ -34,47 +37,42 @@
  *
  * @author Benjamin Bentmann
  *
- * @goal it
- * @phase initialize
- */
+  */
+@Mojo( name = "it", defaultPhase = LifecyclePhase.INITIALIZE )
 public class ItMojo
     extends AbstractMojo
 {
 
     /**
      * The path to the output file.
-     *
-     * @parameter property="touch.outputFile" default-value="target/comp.properties"
      */
+    @Parameter( property = "touch.outputFile", defaultValue = "target/comp.properties" )
     private File outputFile;
 
     /**
      * Component lookup without role hint.
      *
-     * @component
      */
+    @org.apache.maven.plugins.annotations.Component
     private Component componentWithoutRoleHint;
 
     /**
      * Component lookup with explicit role hint.
-     *
-     * @component roleHint="default"
      */
+    @org.apache.maven.plugins.annotations.Component( hint = "default" )
     private Component componentWithRoleHint;
 
     /**
      * Component lookup via active map.
-     *
-     * @component role="org.apache.maven.plugin.coreit.Component"
      */
-    private Map componentMap;
+    @org.apache.maven.plugins.annotations.Component

Review Comment:
   import



##########
core-it-support/core-it-plugins/maven-it-plugin-parameter-implementation/src/main/java/org/apache/maven/plugin/coreit/ParameterImplementationMojo.java:
##########
@@ -30,6 +30,9 @@
 /**
  * Check that we correctly use the implementation parameter.
  *
+ * TODO: this mojo can not be converted to mojo annotations
+ * TODO: because the @Parameter#implementation has never been implemented.
+ *
  * @goal param-implementation

Review Comment:
   https://issues.apache.org/jira/browse/MPLUGIN-410 



##########
core-it-support/core-it-plugins/maven-it-plugin-no-default-comp/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java:
##########
@@ -32,25 +35,23 @@
  *
  * @author Benjamin Bentmann
  *
- * @goal it
- * @phase initialize
- */
+  */
+@Mojo( name = "it", defaultPhase = LifecyclePhase.INITIALIZE )
 public class ItMojo
     extends AbstractMojo
 {
 
     /**
      * The path to the output file.
-     *
-     * @parameter property="touch.outputFile" default-value="target/comp.properties"
      */
+    @Parameter( property = "touch.outputFile", defaultValue = "target/comp.properties" )
     private File outputFile;
 
     /**
      * NOTE: We don't specify a role hint here!
      *
-     * @component
      */
+    @org.apache.maven.plugins.annotations.Component

Review Comment:
   import



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org