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 2021/05/20 12:31:31 UTC

[GitHub] [maven-plugin-tools] rfscholte commented on a change in pull request #33: [MPLUGIN-372] Descriptor mojo fails if super class is provided scope

rfscholte commented on a change in pull request #33:
URL: https://github.com/apache/maven-plugin-tools/pull/33#discussion_r636054191



##########
File path: maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/GeneratorUtils.java
##########
@@ -120,14 +121,14 @@ public static void element( XMLWriter w, String name, String value, boolean asTe
     }
     
     /**
-     * @param dependencies not null list of <code>Dependency</code>
+     * @param dependencies not null collection of <code>Artifact</code>
      * @return list of component dependencies
      */
-    public static List<ComponentDependency> toComponentDependencies( List<Dependency> dependencies )
+    public static List<ComponentDependency> toComponentDependencies( Collection<Artifact> dependencies )
     {
         List<ComponentDependency> componentDeps = new LinkedList<>();
 
-        for ( Dependency dependency : dependencies )
+        for ( Artifact dependency : dependencies )

Review comment:
       rename variable to `artifact`

##########
File path: maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/GeneratorUtils.java
##########
@@ -120,14 +121,14 @@ public static void element( XMLWriter w, String name, String value, boolean asTe
     }
     
     /**
-     * @param dependencies not null list of <code>Dependency</code>
+     * @param dependencies not null collection of <code>Artifact</code>
      * @return list of component dependencies
      */
-    public static List<ComponentDependency> toComponentDependencies( List<Dependency> dependencies )
+    public static List<ComponentDependency> toComponentDependencies( Collection<Artifact> dependencies )

Review comment:
       rename parameter to `artifacts`

##########
File path: maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
##########
@@ -316,13 +307,13 @@ private PluginDescriptor extractPluginDescriptor()
 
         try
         {
-            List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
+            List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getArtifacts() );
             pluginDescriptor.setDependencies( deps );
 
             PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
             request.setEncoding( encoding );
             request.setSkipErrorNoDescriptorsFound( true );
-            request.setDependencies( dependencies );
+            request.setDependencies( new LinkedHashSet<>( project.getArtifacts() ) );

Review comment:
       Are we adding artifacts or dependencies?

##########
File path: maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
##########
@@ -313,7 +305,7 @@ static String getDefaultGoalPrefix( MavenProject project )
         Set<Artifact> filteredDependencies;
         if ( mojoDependencies == null )
         {
-            filteredDependencies = dependencies;
+            filteredDependencies = new LinkedHashSet<>( project.getArtifacts() );

Review comment:
       dependencies or artifacts?




-- 
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.

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