in maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java [323:416]
protected void renderBody() {
startSection(getTitle());
if (!(pluginDescriptor.getMojos() != null
&& pluginDescriptor.getMojos().size() > 0)) {
paragraph(getI18nString("goals.nogoal"));
endSection();
return;
}
paragraph(getI18nString("goals.intro"));
boolean hasMavenReport = false;
for (MojoDescriptor mojo : pluginDescriptor.getMojos()) {
if (GeneratorUtils.isMavenReport(mojo.getImplementation(), project)) {
hasMavenReport = true;
}
}
startTable();
String goalColumnName = getI18nString("goals.column.goal");
String isMavenReport = getI18nString("goals.column.isMavenReport");
String descriptionColumnName = getI18nString("goals.column.description");
if (hasMavenReport) {
tableHeader(new String[] {goalColumnName, isMavenReport, descriptionColumnName});
} else {
tableHeader(new String[] {goalColumnName, descriptionColumnName});
}
List<MojoDescriptor> mojos = new ArrayList<>();
mojos.addAll(pluginDescriptor.getMojos());
PluginUtils.sortMojos(mojos);
for (MojoDescriptor mojo : mojos) {
String goalName = mojo.getFullGoalName();
/*
* Added ./ to define a relative path
* @see AbstractMavenReportRenderer#getValidHref(java.lang.String)
*/
String goalDocumentationLink = "./" + mojo.getGoal() + "-mojo.html";
String description;
if (StringUtils.isNotEmpty(mojo.getDeprecated())) {
description = "<strong>" + getI18nString("goal.deprecated") + "</strong> " + mojo.getDeprecated();
} else if (StringUtils.isNotEmpty(mojo.getDescription())) {
description = mojo.getDescription();
} else {
description = getI18nString("goal.nodescription");
}
sink.tableRow();
tableCell(createLinkPatternedText(goalName, goalDocumentationLink));
if (hasMavenReport) {
if (GeneratorUtils.isMavenReport(mojo.getImplementation(), project)) {
tableCell(getI18nString("isReport"));
} else {
tableCell(getI18nString("isNotReport"));
}
}
tableCell(description, true);
sink.tableRow_();
}
endTable();
startSection(getI18nString("systemrequirements"));
paragraph(getI18nString("systemrequirements.intro"));
startTable();
String maven = discoverMavenRequirement(project, pluginDescriptor);
sink.tableRow();
tableCell(getI18nString("systemrequirements.maven"));
tableCell((maven != null ? maven : getI18nString("systemrequirements.nominimum")));
sink.tableRow_();
String jdk = discoverJdkRequirement(project, pluginDescriptor);
sink.tableRow();
tableCell(getI18nString("systemrequirements.jdk"));
tableCell((jdk != null ? jdk : getI18nString("systemrequirements.nominimum")));
sink.tableRow_();
endTable();
endSection();
renderRequirementsHistories();
renderUsageSection(hasMavenReport);
endSection();
}