This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch section-paritioning in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit ce9b08af025645b51f30530a4d01b40ffb32940a Author: Michael Osipov <micha...@apache.org> AuthorDate: Mon Dec 25 18:37:42 2023 +0100 Move reporting code to section methods As with other renderers move sections to specialized section rendering methods. --- .../plugin/report/PluginOverviewRenderer.java | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java index 5189357e..478fa6e3 100644 --- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java +++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java @@ -87,15 +87,28 @@ class PluginOverviewRenderer extends AbstractPluginReportRenderer { return; } - paragraph(getI18nString("goals.intro")); - boolean hasMavenReport = false; for (MojoDescriptor mojo : pluginDescriptor.getMojos()) { if (PluginUtils.isMavenReport(mojo.getImplementation(), project)) { hasMavenReport = true; + break; } } + renderGoalsSection(hasMavenReport); + + renderSystemRequirementsSection(); + + renderRequirementsHistoriesSection(); + + renderUsageSection(hasMavenReport); + + endSection(); + } + + private void renderGoalsSection(boolean hasMavenReport) { + paragraph(getI18nString("goals.intro")); + startTable(); String goalColumnName = getI18nString("goals.column.goal"); @@ -144,7 +157,9 @@ class PluginOverviewRenderer extends AbstractPluginReportRenderer { } endTable(); + } + private void renderSystemRequirementsSection() { startSection(getI18nString("systemrequirements")); paragraph(getI18nString("systemrequirements.intro")); @@ -166,15 +181,9 @@ class PluginOverviewRenderer extends AbstractPluginReportRenderer { endTable(); endSection(); - - renderRequirementsHistories(); - - renderUsageSection(hasMavenReport); - - endSection(); } - private void renderRequirementsHistories() { + private void renderRequirementsHistoriesSection() { if (requirementsHistories.isEmpty()) { return; }