[ https://issues.apache.org/jira/browse/MPLUGIN-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825870#comment-17825870 ]
ASF GitHub Bot commented on MPLUGIN-511: ---------------------------------------- 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 > 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)