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


##########
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:
   because it was until now used only with current release, where the 
descriptor just had been generated
   but now it is used with history, and I did not take time to extract 
generated content from Maven Central: I chose to just add code to not choke on 
null value



-- 
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-unsubscr...@maven.apache.org

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

Reply via email to