extends AbstractMavenReport {
@Parameter(defaultValue = "${session}", required = true, readonly = true)
protected MavenSession session;
- @Parameter(defaultValue = "${mojoExecution}", required = true, readonly = true)
- private MojoExecution mojoExecution;
-
/**
* Allows specifying the {@linkplain RuleSet} object describing rules
* on artifact versions to ignore when considering updates.
@@ -225,16 +219,6 @@ protected void executeReport(Locale locale) throws MavenReportException {
protected abstract void doGenerateReport(Locale locale, Sink sink)
throws MavenReportException, MojoExecutionException;
- @Override
- protected MavenProject getProject() {
- return project;
- }
-
- @Override
- protected Renderer getSiteRenderer() {
- return siteRenderer;
- }
-
@Override
public String getDescription(Locale locale) {
return getText(locale, "report.description");
@@ -253,7 +237,7 @@ public String getName(Locale locale) {
* @return the message.
*/
public String getText(Locale locale, String key) {
- return i18n.getString(getOutputName(), locale, key);
+ return i18n.getString(getOutputPath(), locale, key);
}
public Boolean getAllowSnapshots() {
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesAggregateReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesAggregateReport.java
similarity index 95%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesAggregateReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesAggregateReport.java
index 14d2928a4d..efc92e5665 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesAggregateReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesAggregateReport.java
@@ -44,10 +44,10 @@
requiresDependencyResolution = ResolutionScope.RUNTIME,
threadSafe = true,
aggregator = true)
-public class DependencyUpdatesAggregateReportMojo extends AbstractDependencyUpdatesReportMojo {
+public class DependencyUpdatesAggregateReport extends AbstractDependencyUpdatesReport {
@Inject
- protected DependencyUpdatesAggregateReportMojo(
+ protected DependencyUpdatesAggregateReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java
similarity index 95%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java
index f9ee65b277..7427ee5d28 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java
@@ -41,10 +41,10 @@
* @since 1.0-beta-1
*/
@Mojo(name = "dependency-updates-report", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true)
-public class DependencyUpdatesReportMojo extends AbstractDependencyUpdatesReportMojo {
+public class DependencyUpdatesReport extends AbstractDependencyUpdatesReport {
@Inject
- protected DependencyUpdatesReportMojo(
+ protected DependencyUpdatesReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
@@ -80,6 +80,7 @@ protected void populateDependencyManagement(
/**
* {@inheritDoc}
*/
+ @Override
public String getOutputName() {
return "dependency-updates-report";
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/ParentUpdatesReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/ParentUpdatesReport.java
similarity index 92%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/ParentUpdatesReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/ParentUpdatesReport.java
index 3e33ff4460..a09d897474 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/ParentUpdatesReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/ParentUpdatesReport.java
@@ -21,16 +21,13 @@
import javax.inject.Inject;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.MavenReportException;
import org.apache.maven.wagon.Wagon;
import org.codehaus.mojo.versions.api.ArtifactVersions;
@@ -48,12 +45,10 @@
* @since 2.13.0
*/
@Mojo(name = "parent-updates-report", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true)
-public class ParentUpdatesReportMojo extends AbstractVersionsReport {
- @Parameter(defaultValue = "${reactorProjects}", required = true, readonly = true)
- protected List reactorProjects;
+public class ParentUpdatesReport extends AbstractVersionsReport {
@Inject
- protected ParentUpdatesReportMojo(
+ protected ParentUpdatesReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
@@ -65,6 +60,7 @@ protected ParentUpdatesReportMojo(
/**
* {@inheritDoc}
*/
+ @Override
public boolean isExternalReport() {
return false;
}
@@ -72,6 +68,7 @@ public boolean isExternalReport() {
/**
* {@inheritDoc}
*/
+ @Override
public boolean canGenerateReport() {
if (getProject().getParent() == null) {
getLog().warn("Project does not have a parent.");
@@ -93,6 +90,7 @@ public boolean canGenerateReport() {
* @param sink the report formatting tool
*/
@SuppressWarnings("deprecation")
+ @Override
protected void doGenerateReport(Locale locale, Sink sink) throws MavenReportException {
try {
ArtifactVersions artifactVersions = getHelper().lookupArtifactVersions(project.getParentArtifact(), false);
@@ -129,6 +127,7 @@ protected void doGenerateReport(Locale locale, Sink sink) throws MavenReportExce
/**
* {@inheritDoc}
*/
+ @Override
public String getOutputName() {
return "parent-updates-report";
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesAggregateReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesAggregateReport.java
similarity index 95%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesAggregateReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesAggregateReport.java
index 7f814dc504..745c20eab4 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesAggregateReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesAggregateReport.java
@@ -43,10 +43,10 @@
requiresDependencyResolution = ResolutionScope.RUNTIME,
threadSafe = true,
aggregator = true)
-public class PluginUpdatesAggregateReportMojo extends AbstractPluginUpdatesReportMojo {
+public class PluginUpdatesAggregateReport extends AbstractPluginUpdatesReport {
@Inject
- protected PluginUpdatesAggregateReportMojo(
+ protected PluginUpdatesAggregateReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
@@ -80,6 +80,7 @@ protected void populatePlugins(Set pluginsCollector) {
/**
* {@inheritDoc}
*/
+ @Override
public String getOutputName() {
return "plugin-updates-aggregate-report";
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesReport.java
similarity index 95%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesReport.java
index 87fbfc7d82..dd0c69f38a 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PluginUpdatesReport.java
@@ -40,10 +40,10 @@
* @since 1.0-beta-1
*/
@Mojo(name = "plugin-updates-report", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true)
-public class PluginUpdatesReportMojo extends AbstractPluginUpdatesReportMojo {
+public class PluginUpdatesReport extends AbstractPluginUpdatesReport {
@Inject
- protected PluginUpdatesReportMojo(
+ protected PluginUpdatesReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
@@ -76,6 +76,7 @@ protected void populatePlugins(Set pluginsCollector) {
/**
* {@inheritDoc}
*/
+ @Override
public String getOutputName() {
return "plugin-updates-report";
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesAggregateReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesAggregateReport.java
similarity index 95%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesAggregateReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesAggregateReport.java
index 61e96b4e64..4d48274411 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesAggregateReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesAggregateReport.java
@@ -47,10 +47,10 @@
requiresDependencyResolution = ResolutionScope.RUNTIME,
threadSafe = true,
aggregator = true)
-public class PropertyUpdatesAggregateReportMojo extends AbstractPropertyUpdatesReportMojo {
+public class PropertyUpdatesAggregateReport extends AbstractPropertyUpdatesReport {
@Inject
- protected PropertyUpdatesAggregateReportMojo(
+ protected PropertyUpdatesAggregateReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
@@ -88,6 +88,7 @@ protected boolean haveBuildProperties() {
/**
* {@inheritDoc}
*/
+ @Override
public String getOutputName() {
return "property-updates-aggregate-report";
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesReportMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesReport.java
similarity index 95%
rename from versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesReportMojo.java
rename to versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesReport.java
index 6d55e1367a..139963a712 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesReportMojo.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/PropertyUpdatesReport.java
@@ -43,9 +43,9 @@
* @since 1.0-beta-1
*/
@Mojo(name = "property-updates-report", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true)
-public class PropertyUpdatesReportMojo extends AbstractPropertyUpdatesReportMojo {
+public class PropertyUpdatesReport extends AbstractPropertyUpdatesReport {
@Inject
- protected PropertyUpdatesReportMojo(
+ protected PropertyUpdatesReport(
I18N i18n,
ArtifactHandlerManager artifactHandlerManager,
RepositorySystem repositorySystem,
@@ -66,6 +66,7 @@ protected void populateUpdateSet(Map propertyCollect
/**
* {@inheritDoc}
*/
+ @Override
public String getOutputName() {
return "property-updates-report";
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/AbstractVersionsReportRenderer.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/AbstractVersionsReportRenderer.java
index 1b9d99ce8e..9f2c9ae94c 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/AbstractVersionsReportRenderer.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/AbstractVersionsReportRenderer.java
@@ -79,45 +79,33 @@ protected AbstractVersionsReportRenderer(
* {@inheritDoc}
*/
protected void renderBody() {
- sink.section1();
- sink.sectionTitle1();
- sink.text(getText("report.overview.title"));
- sink.sectionTitle1_();
- sink.paragraph();
- sink.text(getText("report.overview.text"));
- sink.paragraph_();
+ startSection(getText("report.overview.title"));
+ paragraph(getText("report.overview.text"));
renderOverview();
renderManagementSummaryTable();
renderSummaryTable();
- sink.section1_();
+ endSection();
- sink.section1();
- sink.sectionTitle1();
- sink.text(getText("report.detail.title"));
- sink.sectionTitle1_();
- sink.paragraph();
- sink.text(getText("report.detail.text"));
- sink.paragraph_();
+ startSection(getText("report.detail.title"));
+ paragraph(getText("report.detail.text"));
renderDetails();
- sink.section1_();
+ endSection();
}
/**
* Renders the "Overview" table
*/
protected void renderOverview() {
- sink.table();
- sink.tableRows(null, false);
+ startTable();
sink.tableRow();
renderOverviewTableRow(computeOverviewStats());
sink.tableRow_();
- sink.tableRows_();
- sink.table_();
+ endTable();
}
/**
@@ -188,8 +176,7 @@ protected void renderIcon(boolean success) {
protected abstract void renderDetails();
protected void renderSummaryTable(Map contents, boolean hasScope) {
- sink.table();
- sink.tableRows(null, false);
+ startTable();
sink.tableRow();
renderSummaryTableHeader(hasScope, true);
@@ -201,8 +188,7 @@ protected void renderSummaryTable(Map contents, bo
renderSummaryTableHeader(hasScope, true);
sink.tableRow_();
- sink.tableRows_();
- sink.table_();
+ endTable();
}
protected void renderSummaryTableHeader(boolean hasScope, boolean hasType) {
@@ -253,8 +239,7 @@ protected void renderDependencyDetailTable(Dependency artifact, ArtifactVersions
ArtifactVersion[] allUpdates = allUpdatesCache.get(details, empty(), isAllowSnapshots());
boolean upToDate = allUpdates == null || allUpdates.length == 0;
- sink.table();
- sink.tableRows(new int[] {Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_LEFT}, false);
+ startTable(new int[] {Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_LEFT}, false);
renderTwoCellsRow("report.status", () -> renderStatus(details));
renderTwoCellsRow("report.groupId", artifact.getGroupId());
@@ -269,8 +254,7 @@ protected void renderDependencyDetailTable(Dependency artifact, ArtifactVersions
renderTwoCellsRow("report.updateVersions", () -> renderVersions(allUpdates, details));
}
- sink.tableRows_();
- sink.table_();
+ endTable();
}
/**
@@ -347,7 +331,7 @@ private List getArtifactVersionRange(AbstractVersionDetails details
} catch (InvalidVersionSpecificationException ignored) {
ignored.printStackTrace(System.err);
}
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
/**
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/DependencyUpdatesReportRenderer.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/DependencyUpdatesReportRenderer.java
index 7233e3371c..983247002a 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/DependencyUpdatesReportRenderer.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/DependencyUpdatesReportRenderer.java
@@ -62,19 +62,14 @@ protected void renderManagementSummaryTable() {
}
protected void renderTable(String titleKey, Map contents, String emptyKey) {
- sink.section2();
- sink.sectionTitle2();
- sink.text(getText(titleKey));
- sink.sectionTitle2_();
+ startSection(getText(titleKey));
if (contents.isEmpty()) {
- sink.paragraph();
- sink.text(getText(emptyKey));
- sink.paragraph_();
+ paragraph(getText(emptyKey));
} else {
renderSummaryTable(contents, true);
}
- sink.section2_();
+ endSection();
}
@Override
@@ -83,11 +78,8 @@ protected OverviewStats computeOverviewStats() {
}
protected void renderDependencyDetail(Dependency artifact, ArtifactVersions details) {
- sink.section2();
- sink.sectionTitle2();
- sink.text(ArtifactUtils.versionlessKey(artifact.getGroupId(), artifact.getArtifactId()));
- sink.sectionTitle2_();
+ startSection(ArtifactUtils.versionlessKey(artifact.getGroupId(), artifact.getArtifactId()));
renderDependencyDetailTable(artifact, details, true);
- sink.section2_();
+ endSection();
}
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PluginUpdatesReportRenderer.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PluginUpdatesReportRenderer.java
index 43a2d059fe..16beebc60d 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PluginUpdatesReportRenderer.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PluginUpdatesReportRenderer.java
@@ -65,35 +65,26 @@ protected void renderDetails() {
}
private void renderDependencyDetail(Dependency dependency, ArtifactVersions details) {
- sink.section3();
- sink.sectionTitle3();
- sink.text(MessageFormat.format(
+ startSection(MessageFormat.format(
getText("report.pluginDependency"),
ArtifactUtils.versionlessKey(dependency.getGroupId(), dependency.getArtifactId())));
- sink.sectionTitle3_();
renderDependencyDetailTable(dependency, details, false);
- sink.section3_();
+ endSection();
}
private void renderTable(String titleKey, Map contents, String emptyKey) {
- sink.section2();
- sink.sectionTitle2();
- sink.text(getText(titleKey));
- sink.sectionTitle2_();
+ startSection(getText(titleKey));
if (contents.isEmpty()) {
- sink.paragraph();
- sink.text(getText(emptyKey));
- sink.paragraph_();
+ paragraph(getText(emptyKey));
} else {
renderSummaryTable(contents);
}
- sink.section2_();
+ endSection();
}
protected void renderSummaryTable(Map contents) {
- sink.table();
- sink.tableRows(null, false);
+ startTable();
sink.tableRow();
renderSummaryTableHeader(false, false);
@@ -105,8 +96,7 @@ protected void renderSummaryTable(Map contents
renderSummaryTableHeader(false, false);
sink.tableRow_();
- sink.tableRows_();
- sink.table_();
+ endTable();
}
/**
@@ -153,29 +143,21 @@ protected void renderSummaryTableRow(Dependency artifact, PluginUpdatesDetails d
}
private void renderPluginDetail(Dependency artifact, PluginUpdatesDetails details) {
- sink.section2();
- sink.sectionTitle2();
- sink.text(MessageFormat.format(
+ startSection(MessageFormat.format(
getText("report.plugin"), ArtifactUtils.versionlessKey(details.getGroupId(), details.getArtifactId())));
- sink.sectionTitle2_();
-
renderPluginDetailTable(details);
if (!details.getDependencyVersions().isEmpty()) {
- sink.section3();
- sink.sectionTitle3();
- sink.text(MessageFormat.format(
+ startSection(MessageFormat.format(
getText("report.pluginDependencies"),
ArtifactUtils.versionlessKey(details.getGroupId(), details.getArtifactId())));
- sink.sectionTitle3_();
renderSummaryTable(details.getDependencyVersions(), false);
-
- sink.section3_();
+ endSection();
details.getDependencyVersions().forEach(this::renderDependencyDetail);
}
- sink.section2_();
+ endSection();
}
private void renderPluginDetailTable(PluginUpdatesDetails details) {
@@ -183,8 +165,7 @@ private void renderPluginDetailTable(PluginUpdatesDetails details) {
ArtifactVersion[] allUpdates = details.getAllUpdates(empty(), isAllowSnapshots());
boolean upToDate = allUpdates == null || allUpdates.length == 0;
- sink.table();
- sink.tableRows(new int[] {Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_LEFT}, false);
+ startTable(new int[] {Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_LEFT}, false);
renderTwoCellsRow("report.status", () -> renderStatus(details));
renderTwoCellsRow("report.groupId", details.getGroupId());
@@ -194,7 +175,6 @@ private void renderPluginDetailTable(PluginUpdatesDetails details) {
renderTwoCellsRow("report.updateVersions", () -> renderVersions(allUpdates, details));
}
- sink.tableRows_();
- sink.table_();
+ endTable();
}
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PropertyUpdatesReportRenderer.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PropertyUpdatesReportRenderer.java
index 5c7269f5ef..273790a940 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PropertyUpdatesReportRenderer.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/PropertyUpdatesReportRenderer.java
@@ -52,7 +52,7 @@ protected void renderManagementSummaryTable() {}
@Override
protected void renderSummaryTable() {
- renderTable("report.overview.property", model.getAllUpdates(), "report.overview.noProperty");
+ renderTable(model.getAllUpdates());
}
/**
@@ -63,25 +63,19 @@ protected void renderDetails() {
model.getAllUpdates().forEach(this::renderPropertyDetail);
}
- protected void renderTable(String titleKey, Map contents, String emptyKey) {
- sink.section2();
- sink.sectionTitle2();
- sink.text(getText(titleKey));
- sink.sectionTitle2_();
+ protected void renderTable(Map contents) {
+ startSection(getText("report.overview.property"));
if (contents.isEmpty()) {
- sink.paragraph();
- sink.text(getText(emptyKey));
- sink.paragraph_();
+ paragraph(getText("report.overview.noProperty"));
} else {
renderSummaryTable(contents);
}
- sink.section2_();
+ endSection();
}
protected void renderSummaryTable(Map contents) {
- sink.table();
- sink.tableRows(null, false);
+ startTable();
sink.tableRow();
renderSummaryTableHeader(false, false);
@@ -93,8 +87,7 @@ protected void renderSummaryTable(Map contents) {
renderSummaryTableHeader(false, false);
sink.tableRow_();
- sink.tableRows_();
- sink.table_();
+ endTable();
}
private void renderPropertySummaryTableRow(Property property, PropertyVersions details) {
@@ -117,8 +110,7 @@ protected void renderPropertyDetailTable(Property property, PropertyVersions det
ArtifactVersion[] allUpdates = allUpdatesCache.get(details, empty(), isAllowSnapshots());
boolean upToDate = allUpdates == null || allUpdates.length == 0;
- sink.table();
- sink.tableRows(new int[] {Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_LEFT}, false);
+ startTable(new int[] {Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_LEFT}, false);
renderTwoCellsRow("report.status", () -> renderStatus(details));
renderTwoCellsRow("report.property", "${" + property.getName() + "}");
@@ -133,8 +125,7 @@ protected void renderPropertyDetailTable(Property property, PropertyVersions det
renderTwoCellsRow("report.searchReactor", property.isSearchReactor());
renderTwoCellsRow("report.preferReactor", property.isPreferReactor());
- sink.tableRows_();
- sink.table_();
+ endTable();
}
/**
@@ -174,11 +165,8 @@ protected OverviewStats computeOverviewStats() {
}
private void renderPropertyDetail(Property property, PropertyVersions details) {
- sink.section2();
- sink.sectionTitle2();
- sink.text("${" + property.getName() + "}");
- sink.sectionTitle2_();
+ startSection("${" + property.getName() + "}");
renderPropertyDetailTable(property, details);
- sink.section2_();
+ endSection();
}
}
diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/VersionsReportRendererBase.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/VersionsReportRendererBase.java
index 10fa592e79..b46f2ce204 100644
--- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/VersionsReportRendererBase.java
+++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/reporting/VersionsReportRendererBase.java
@@ -55,7 +55,8 @@ public abstract class VersionsReportRendererBase extends AbstractMavenReportRend
*/
protected String bundleName;
- public VersionsReportRendererBase(Sink sink, I18N i18n, Locale locale, String bundleName, boolean allowSnapshots) {
+ protected VersionsReportRendererBase(
+ Sink sink, I18N i18n, Locale locale, String bundleName, boolean allowSnapshots) {
super(sink);
this.i18n = i18n;
this.locale = locale;
@@ -102,11 +103,7 @@ protected boolean equals(ArtifactVersion v1, ArtifactVersion v2) {
* headers from
*/
protected void renderTableHeaderCells(String... keys) {
- Arrays.stream(keys).map(this::getText).forEachOrdered(str -> {
- sink.tableHeaderCell();
- sink.text(str);
- sink.tableHeaderCell_();
- });
+ Arrays.stream(keys).map(this::getText).forEachOrdered(this::tableHeaderCell);
}
/**
diff --git a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/DependencyUpdatesReportMojoTest.java b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/DependencyUpdatesReportTest.java
similarity index 89%
rename from versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/DependencyUpdatesReportMojoTest.java
rename to versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/DependencyUpdatesReportTest.java
index c4da46e7b6..e85d9946c3 100644
--- a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/DependencyUpdatesReportMojoTest.java
+++ b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/DependencyUpdatesReportTest.java
@@ -57,15 +57,15 @@
import static org.hamcrest.Matchers.matchesPattern;
/**
- * Basic tests for {@linkplain DependencyUpdatesReportMojo}.
+ * Basic tests for {@linkplain DependencyUpdatesReport}.
*
* @author Andrzej Jarmoniuk
*/
-public class DependencyUpdatesReportMojoTest {
- private static class TestDependencyUpdatesReportMojo extends DependencyUpdatesReportMojo {
+public class DependencyUpdatesReportTest {
+ private static class TestDependencyUpdatesReport extends DependencyUpdatesReport {
private static final I18N MOCK_I18N = mockI18N();
- TestDependencyUpdatesReportMojo() {
+ TestDependencyUpdatesReport() {
super(
MOCK_I18N,
mockArtifactHandlerManager(),
@@ -82,17 +82,17 @@ private static class TestDependencyUpdatesReportMojo extends DependencyUpdatesRe
session = mockMavenSession();
}
- public TestDependencyUpdatesReportMojo withDependencies(Dependency... dependencies) {
+ public TestDependencyUpdatesReport withDependencies(Dependency... dependencies) {
project.setDependencies(Arrays.asList(dependencies));
return this;
}
- public TestDependencyUpdatesReportMojo withAetherRepositorySystem(RepositorySystem repositorySystem) {
+ public TestDependencyUpdatesReport withAetherRepositorySystem(RepositorySystem repositorySystem) {
this.repositorySystem = repositorySystem;
return this;
}
- public TestDependencyUpdatesReportMojo withOriginalDependencyManagement(
+ public TestDependencyUpdatesReport withOriginalDependencyManagement(
Dependency... originalDependencyManagement) {
project.getOriginalModel()
.getDependencyManagement()
@@ -100,48 +100,48 @@ public TestDependencyUpdatesReportMojo withOriginalDependencyManagement(
return this;
}
- public TestDependencyUpdatesReportMojo withDependencyManagement(Dependency... dependencyManagement) {
+ public TestDependencyUpdatesReport withDependencyManagement(Dependency... dependencyManagement) {
project.getModel().getDependencyManagement().setDependencies(Arrays.asList(dependencyManagement));
return this;
}
- public TestDependencyUpdatesReportMojo withOnlyUpgradable(boolean onlyUpgradable) {
+ public TestDependencyUpdatesReport withOnlyUpgradable(boolean onlyUpgradable) {
this.onlyUpgradable = onlyUpgradable;
return this;
}
- public TestDependencyUpdatesReportMojo withProcessDependencyManagement(boolean processDependencyManagement) {
+ public TestDependencyUpdatesReport withProcessDependencyManagement(boolean processDependencyManagement) {
this.processDependencyManagement = processDependencyManagement;
return this;
}
- public TestDependencyUpdatesReportMojo withProcessDependencyManagementTransitive(
+ public TestDependencyUpdatesReport withProcessDependencyManagementTransitive(
boolean processDependencyManagementTransitive) {
this.processDependencyManagementTransitive = processDependencyManagementTransitive;
return this;
}
- public TestDependencyUpdatesReportMojo withOnlyProjectDependencies(boolean onlyProjectDependencies) {
+ public TestDependencyUpdatesReport withOnlyProjectDependencies(boolean onlyProjectDependencies) {
this.onlyProjectDependencies = onlyProjectDependencies;
return this;
}
- public TestDependencyUpdatesReportMojo withRuleSet(RuleSet ruleSet) {
+ public TestDependencyUpdatesReport withRuleSet(RuleSet ruleSet) {
this.ruleSet = ruleSet;
return this;
}
- public TestDependencyUpdatesReportMojo withIgnoredVersions(Set ignoredVersions) {
+ public TestDependencyUpdatesReport withIgnoredVersions(Set ignoredVersions) {
this.ignoredVersions = ignoredVersions;
return this;
}
- public TestDependencyUpdatesReportMojo withAllowSnapshots(boolean allowSnapshots) {
+ public TestDependencyUpdatesReport withAllowSnapshots(boolean allowSnapshots) {
this.allowSnapshots = allowSnapshots;
return this;
}
- public TestDependencyUpdatesReportMojo withOriginalProperty(String name, String value) {
+ public TestDependencyUpdatesReport withOriginalProperty(String name, String value) {
project.getOriginalModel().getProperties().put(name, value);
return this;
}
@@ -166,7 +166,7 @@ private static Dependency dependencyOf(String artifactId, String version) {
public void testOnlyUpgradableDependencies() throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withOnlyUpgradable(true)
.withAetherRepositorySystem(mockAetherRepositorySystem(new HashMap() {
{
@@ -192,7 +192,7 @@ public void testOnlyUpgradableWithOriginalDependencyManagement()
throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withOriginalDependencyManagement(
dependencyOf("artifactA"), dependencyOf("artifactB"), dependencyOf("artifactC"))
.withProcessDependencyManagement(true)
@@ -209,7 +209,7 @@ public void testOnlyUpgradableWithTransitiveDependencyManagement()
throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withDependencyManagement(
dependencyOf("artifactA"), dependencyOf("artifactB"), dependencyOf("artifactC"))
.withProcessDependencyManagement(true)
@@ -226,7 +226,7 @@ public void testOnlyUpgradableWithTransitiveDependencyManagement()
public void testOnlyProjectDependencies() throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withDependencies(dependencyOf("artifactA"))
.withDependencyManagement(
dependencyOf("artifactA"), dependencyOf("artifactB"), dependencyOf("artifactC"))
@@ -244,7 +244,7 @@ public void testOnlyProjectDependenciesWithIgnoredVersions()
throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withDependencies(dependencyOf("artifactA"))
.withDependencyManagement(
dependencyOf("artifactA"), dependencyOf("artifactB"), dependencyOf("artifactC"))
@@ -264,7 +264,7 @@ public void testOnlyProjectDependenciesWithIgnoredVersions()
public void testDependenciesInAlphabeticalOrder() throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withAetherRepositorySystem(mockAetherRepositorySystem(new HashMap() {
{
put("amstrad", new String[] {"1.0.0", "2.0.0"});
@@ -292,7 +292,7 @@ public void testDependenciesShouldOverrideDependencyManagement()
throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withProcessDependencyManagement(true)
.withProcessDependencyManagementTransitive(true)
.withDependencies(dependencyOf("artifactA", "2.0.0"), dependencyOf("artifactB"))
@@ -307,7 +307,7 @@ public void testDependenciesShouldOverrideDependencyManagement()
public void testWrongReportBounds() throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withOnlyUpgradable(true)
.withDependencies(dependencyOf("test-artifact"))
.withAetherRepositorySystem(mockAetherRepositorySystem(new HashMap() {
@@ -329,7 +329,7 @@ public void testWrongReportBounds() throws IOException, MavenReportException, Il
public void testIt001Overview() throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withOnlyUpgradable(true)
.withDependencies(dependencyOf("test-artifact", "1.1"))
.withAetherRepositorySystem(mockAetherRepositorySystem(new HashMap() {
@@ -357,7 +357,7 @@ public void testResolvedVersionsWithoutTransitiveDependencyManagement()
throws IOException, MavenReportException, IllegalAccessException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withOriginalDependencyManagement(
dependencyOf("artifactA", "1.0.0"), dependencyOf("artifactB", "${mycomponent.version}"))
.withDependencyManagement(
@@ -376,7 +376,7 @@ public void testResolvedVersionsWithoutTransitiveDependencyManagement()
public void testVersionlessDependency() throws IOException, MavenReportException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestDependencyUpdatesReportMojo()
+ new TestDependencyUpdatesReport()
.withOriginalDependencyManagement(dependencyOf("artifactA", null))
.withProcessDependencyManagement(true)
.withProcessDependencyManagementTransitive(false)
diff --git a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/ParentUpdatesReportMojoTest.java b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/ParentUpdatesReportTest.java
similarity index 96%
rename from versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/ParentUpdatesReportMojoTest.java
rename to versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/ParentUpdatesReportTest.java
index 579aa1d0d5..d06454d3d2 100644
--- a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/ParentUpdatesReportMojoTest.java
+++ b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/ParentUpdatesReportTest.java
@@ -47,18 +47,18 @@
import static org.hamcrest.Matchers.allOf;
/**
- * Basic tests for {@linkplain ParentUpdatesReportMojo}.
+ * Basic tests for {@linkplain ParentUpdatesReport}.
*
* @author Andrzej Jarmoniuk
*/
-public class ParentUpdatesReportMojoTest {
+public class ParentUpdatesReportTest {
private static final I18N MOCK_I18N = mockI18N();
@Test
public void testAllowSnapshots() throws IOException, MavenReportException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new ParentUpdatesReportMojo(
+ new ParentUpdatesReport(
MOCK_I18N,
mockArtifactHandlerManager(),
mockAetherRepositorySystem(new HashMap() {
diff --git a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PluginUpdatesReportMojoTest.java b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PluginUpdatesReportTest.java
similarity index 88%
rename from versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PluginUpdatesReportMojoTest.java
rename to versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PluginUpdatesReportTest.java
index 3040378dda..e5597238b6 100644
--- a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PluginUpdatesReportMojoTest.java
+++ b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PluginUpdatesReportTest.java
@@ -53,15 +53,15 @@
import static org.hamcrest.Matchers.matchesPattern;
/**
- * Basic tests for {@linkplain PluginUpdatesReportMojo}.
+ * Basic tests for {@linkplain PluginUpdatesReport}.
*
* @author Andrzej Jarmoniuk
*/
-public class PluginUpdatesReportMojoTest {
- private static class TestPluginUpdatesReportMojo extends PluginUpdatesReportMojo {
+public class PluginUpdatesReportTest {
+ private static class TestPluginUpdatesReport extends PluginUpdatesReport {
static final I18N MOCK_I18N = mockI18N();
- TestPluginUpdatesReportMojo() {
+ TestPluginUpdatesReport() {
super(
MOCK_I18N,
mockArtifactHandlerManager(),
@@ -77,37 +77,37 @@ private static class TestPluginUpdatesReportMojo extends PluginUpdatesReportMojo
session = mockMavenSession();
}
- public TestPluginUpdatesReportMojo withPlugins(Plugin... plugins) {
+ public TestPluginUpdatesReport withPlugins(Plugin... plugins) {
project.getBuild().setPlugins(Arrays.asList(plugins));
return this;
}
- public TestPluginUpdatesReportMojo withAetherRepositorySystem(RepositorySystem repositorySystem) {
+ public TestPluginUpdatesReport withAetherRepositorySystem(RepositorySystem repositorySystem) {
this.repositorySystem = repositorySystem;
return this;
}
- public TestPluginUpdatesReportMojo withPluginManagement(Plugin... pluginManagement) {
+ public TestPluginUpdatesReport withPluginManagement(Plugin... pluginManagement) {
project.getBuild().getPluginManagement().setPlugins(Arrays.asList(pluginManagement));
return this;
}
- public TestPluginUpdatesReportMojo withOnlyUpgradable(boolean onlyUpgradable) {
+ public TestPluginUpdatesReport withOnlyUpgradable(boolean onlyUpgradable) {
this.onlyUpgradable = onlyUpgradable;
return this;
}
- public TestPluginUpdatesReportMojo withOnlyProjectPlugins(boolean onlyProjectPlugins) {
+ public TestPluginUpdatesReport withOnlyProjectPlugins(boolean onlyProjectPlugins) {
this.onlyProjectPlugins = onlyProjectPlugins;
return this;
}
- public TestPluginUpdatesReportMojo withRuleSet(RuleSet ruleSet) {
+ public TestPluginUpdatesReport withRuleSet(RuleSet ruleSet) {
this.ruleSet = ruleSet;
return this;
}
- public TestPluginUpdatesReportMojo withIgnoredVersions(Set ignoredVersions) {
+ public TestPluginUpdatesReport withIgnoredVersions(Set ignoredVersions) {
this.ignoredVersions = ignoredVersions;
return this;
}
@@ -131,7 +131,7 @@ private static Plugin pluginOf(String artifactId, String version) {
public void testOnlyUpgradablePlugins() throws IOException, MavenReportException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestPluginUpdatesReportMojo()
+ new TestPluginUpdatesReport()
.withAetherRepositorySystem(mockAetherRepositorySystem(new HashMap() {
{
put("artifactA", new String[] {"1.0.0", "2.0.0"});
@@ -154,7 +154,7 @@ public void testOnlyUpgradablePlugins() throws IOException, MavenReportException
public void testOnlyUpgradableWithPluginManagement() throws IOException, MavenReportException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestPluginUpdatesReportMojo()
+ new TestPluginUpdatesReport()
.withAetherRepositorySystem(mockAetherRepositorySystem(new HashMap() {
{
put("artifactA", new String[] {"1.0.0", "2.0.0"});
@@ -177,7 +177,7 @@ public void testOnlyUpgradableWithPluginManagement() throws IOException, MavenRe
public void testOnlyProjectPlugins() throws IOException, MavenReportException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestPluginUpdatesReportMojo()
+ new TestPluginUpdatesReport()
.withPlugins(pluginOf("artifactA"))
.withPluginManagement(pluginOf("artifactA"), pluginOf("artifactB"), pluginOf("artifactC"))
.withOnlyUpgradable(true)
@@ -193,7 +193,7 @@ public void testOnlyProjectPlugins() throws IOException, MavenReportException {
public void testOnlyProjectPluginsWithIgnoredVersions() throws IOException, MavenReportException {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- new TestPluginUpdatesReportMojo()
+ new TestPluginUpdatesReport()
.withPlugins(pluginOf("artifactA"))
.withPluginManagement(pluginOf("artifactA"), pluginOf("artifactB"), pluginOf("artifactC"))
.withOnlyUpgradable(true)
diff --git a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PropertyUpdatesReportMojoTest.java b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PropertyUpdatesReportTest.java
similarity index 91%
rename from versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PropertyUpdatesReportMojoTest.java
rename to versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PropertyUpdatesReportTest.java
index a0769942a0..b41eb443a4 100644
--- a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PropertyUpdatesReportMojoTest.java
+++ b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/PropertyUpdatesReportTest.java
@@ -39,9 +39,9 @@
import static org.hamcrest.Matchers.not;
/**
- * Unit tests for {@link PropertyUpdatesReportMojo}
+ * Unit tests for {@link PropertyUpdatesReport}
*/
-public class PropertyUpdatesReportMojoTest extends AbstractMojoTestCase {
+public class PropertyUpdatesReportTest extends AbstractMojoTestCase {
@Rule
public MojoRule mojoRule = new MojoRule(this);
@@ -53,7 +53,7 @@ public void testIncludeParentTrueShouldContainProperty() throws Exception {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- PropertyUpdatesReportMojo mojo = (PropertyUpdatesReportMojo) mojoRule.lookupConfiguredMojo(
+ PropertyUpdatesReport mojo = (PropertyUpdatesReport) mojoRule.lookupConfiguredMojo(
new File("src/test/resources/org/codehaus/mojo/display-property-updates/issue-367/child"),
"property-updates-report");
setVariableValueToObject(mojo, "siteTool", SITE_TOOL);
@@ -73,7 +73,7 @@ public void testIncludeParentFalseShouldNotContainProperty() throws Exception {
OutputStream os = new ByteArrayOutputStream();
SinkFactory sinkFactory = new Xhtml5SinkFactory();
- PropertyUpdatesReportMojo mojo = (PropertyUpdatesReportMojo) mojoRule.lookupConfiguredMojo(
+ PropertyUpdatesReport mojo = (PropertyUpdatesReport) mojoRule.lookupConfiguredMojo(
new File("src/test/resources/org/codehaus/mojo/display-property-updates/issue-367/child"),
"property-updates-report");
setVariableValueToObject(mojo, "siteTool", SITE_TOOL);
diff --git a/versions-test/pom.xml b/versions-test/pom.xml
index 41906af21b..1068fc6958 100644
--- a/versions-test/pom.xml
+++ b/versions-test/pom.xml
@@ -56,10 +56,6 @@
org.apache.maven.doxia
doxia-integration-tools
-
- org.apache.maven.doxia
- doxia-decoration-model
-
org.apache.commons
commons-text