[ 
https://issues.apache.org/jira/browse/MPLUGIN-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17826866#comment-17826866
 ] 

ASF GitHub Bot commented on MPLUGIN-511:
----------------------------------------

michael-o commented on code in PR #269:
URL: 
https://github.com/apache/maven-plugin-tools/pull/269#discussion_r1523907398


##########
maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java:
##########
@@ -93,6 +110,14 @@ public class PluginReport extends AbstractMavenReport {
     @Parameter
     private List<RequirementsHistory> requirementsHistories = new 
ArrayList<>();
 
+    /**
+     * Plugin's version range for automatic detection of requirements history.
+     *
+     * @since 3.12.0
+     */
+    @Parameter(defaultValue = "[0,)")
+    private String requirementsHistoryDetectRange;

Review Comment:
   `requirementsHistoryDetectionRange`



##########
maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/RequirementsHistory.java:
##########
@@ -72,16 +73,23 @@ public String toString() {
         return sb.toString();
     }
 
+    public static RequirementsHistory discoverRequirements(MavenProject 
project) {
+        RequirementsHistory req = new RequirementsHistory();
+        req.version = project.getVersion();
+        req.jdk = discoverJdkRequirement(project, null);
+        req.maven = discoverMavenRequirement(project, null);
+        return req;
+    }
     /**
      * Tries to determine the Maven requirement from either the plugin 
descriptor or (if not set) from the
      * Maven prerequisites element in the POM.
      *
      * @param project      not null
-     * @param pluginDescriptor the plugin descriptor (not null)
+     * @param pluginDescriptor the plugin descriptor (can be null)
      * @return the Maven version or null if not specified
      */
     public static String discoverMavenRequirement(MavenProject project, 
PluginDescriptor pluginDescriptor) {
-        if 
(StringUtils.isNotBlank(pluginDescriptor.getRequiredMavenVersion())) {
+        if (pluginDescriptor != null && 
StringUtils.isNotBlank(pluginDescriptor.getRequiredMavenVersion())) {

Review Comment:
   I see, makes sense.





> create and share tooling to detect plugin prerequisites history
> ---------------------------------------------------------------
>
>                 Key: MPLUGIN-511
>                 URL: https://issues.apache.org/jira/browse/MPLUGIN-511
>             Project: Maven Plugin Tools
>          Issue Type: Improvement
>          Components: Plugin Plugin
>    Affects Versions: 3.11.0
>            Reporter: Herve Boutemy
>            Priority: Major
>             Fix For: 3.12.0
>
>
> to help creating documentation needed on plugins when implementing 
> MPLUGIN-400, i.e. fill requirementsHistories 
> [https://maven.apache.org/plugin-tools-archives/plugin-tools-3.7.0/maven-plugin-report-plugin/report-mojo.html#requirementshistories]
>  
> this will be useful both for Maven project itself, because we have 52 plugins 
> to work on 
> [https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-dist-tool/job/master/site/dist-tool-prerequisites.html]
> but this will help also every plugin maintainers: MojoHaus, others



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to