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