Skip to content

Commit 64a3814

Browse files
Upgrade to Doxia 2.x stack
fix: #1168
1 parent a3ab213 commit 64a3814

32 files changed

+190
-310
lines changed

pom.xml

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
<scm>
105105
<connection>scm:git:https://github.com/mojohaus/versions.git</connection>
106106
<developerConnection>scm:git:ssh://[email protected]/mojohaus/versions.git</developerConnection>
107-
<tag>2.15.0</tag>
107+
<tag>HEAD</tag>
108108
<url>https://github.com/mojohaus/versions/tree/master</url>
109109
</scm>
110110

@@ -120,8 +120,12 @@
120120

121121
<properties>
122122
<mavenVersion>3.6.3</mavenVersion>
123-
<doxiaVersion>1.12.0</doxiaVersion>
124-
<doxia-sitetoolsVersion>1.11.1</doxia-sitetoolsVersion>
123+
124+
<doxiaVersion>2.0.0</doxiaVersion>
125+
<doxia-sitetoolsVersion>2.0.0</doxia-sitetoolsVersion>
126+
<reportingApiVersion>4.0.0</reportingApiVersion>
127+
<reportingImplVersion>4.0.0</reportingImplVersion>
128+
125129
<mockitoVersion>4.11.0</mockitoVersion>
126130
<woodstoxVersion>7.1.0</woodstoxVersion>
127131
<stax2ApiVersion>4.2.2</stax2ApiVersion>
@@ -134,8 +138,10 @@
134138
<modelloNamespaceRuleVersion>2.1.0</modelloNamespaceRuleVersion>
135139
<modelloNamespaceReportVersion>2.0.0</modelloNamespaceReportVersion>
136140
<byteBuddyVersion>1.15.10</byteBuddyVersion>
141+
137142
<!-- use the same version as in Maven core -->
138143
<mavenResolverVersion>1.4.1</mavenResolverVersion>
144+
<sisuVersion>0.3.4</sisuVersion>
139145

140146
<scmpublish.content>${project.build.directory}/staging/versions</scmpublish.content>
141147
<!-- execute ITS in parallel by default -->
@@ -214,10 +220,16 @@
214220
<dependency>
215221
<groupId>org.eclipse.sisu</groupId>
216222
<artifactId>org.eclipse.sisu.plexus</artifactId>
217-
<!-- use the same version as in Maven core -->
218-
<version>0.3.4</version>
223+
<version>${sisuVersion}</version>
219224
<scope>provided</scope>
220225
</dependency>
226+
<dependency>
227+
<groupId>org.eclipse.sisu</groupId>
228+
<artifactId>org.eclipse.sisu.inject</artifactId>
229+
<version>${sisuVersion}</version>
230+
<!-- we need change scope to allow working no-nullable in transitive components -->
231+
<scope>runtime</scope>
232+
</dependency>
221233

222234
<dependency>
223235
<groupId>org.apache.maven.enforcer</groupId>
@@ -228,24 +240,18 @@
228240
<dependency>
229241
<groupId>org.apache.maven.reporting</groupId>
230242
<artifactId>maven-reporting-api</artifactId>
231-
<version>3.1.1</version>
243+
<version>${reportingApiVersion}</version>
232244
</dependency>
233245
<dependency>
234246
<groupId>org.apache.maven.reporting</groupId>
235247
<artifactId>maven-reporting-impl</artifactId>
236-
<version>3.2.0</version>
248+
<version>${reportingImplVersion}</version>
237249
</dependency>
238250

239251
<dependency>
240252
<groupId>org.apache.maven.doxia</groupId>
241253
<artifactId>doxia-core</artifactId>
242254
<version>${doxiaVersion}</version>
243-
<exclusions>
244-
<exclusion>
245-
<groupId>org.codehaus.plexus</groupId>
246-
<artifactId>plexus-container-default</artifactId>
247-
</exclusion>
248-
</exclusions>
249255
</dependency>
250256
<dependency>
251257
<groupId>org.apache.maven.doxia</groupId>
@@ -254,26 +260,21 @@
254260
</dependency>
255261

256262
<dependency>
257-
<groupId>org.apache.maven.doxia</groupId>
258-
<artifactId>doxia-site-renderer</artifactId>
259-
<version>${doxia-sitetoolsVersion}</version>
263+
<groupId>org.codehaus.plexus</groupId>
264+
<artifactId>plexus-i18n</artifactId>
265+
<version>1.0-beta-10</version>
260266
<exclusions>
261267
<exclusion>
262268
<groupId>org.codehaus.plexus</groupId>
263-
<artifactId>plexus-container-default</artifactId>
269+
<artifactId>plexus-component-api</artifactId>
264270
</exclusion>
265271
</exclusions>
266272
</dependency>
273+
267274
<dependency>
268275
<groupId>org.apache.maven.doxia</groupId>
269276
<artifactId>doxia-integration-tools</artifactId>
270277
<version>${doxia-sitetoolsVersion}</version>
271-
<exclusions>
272-
<exclusion>
273-
<groupId>org.codehaus.plexus</groupId>
274-
<artifactId>plexus-container-default</artifactId>
275-
</exclusion>
276-
</exclusions>
277278
</dependency>
278279

279280
<dependency>
@@ -359,11 +360,6 @@
359360
<artifactId>commons-io</artifactId>
360361
<version>2.17.0</version>
361362
</dependency>
362-
<dependency>
363-
<groupId>dom4j</groupId>
364-
<artifactId>dom4j</artifactId>
365-
<version>1.6.1</version>
366-
</dependency>
367363
<dependency>
368364
<groupId>org.codehaus.plexus</groupId>
369365
<artifactId>plexus-archiver</artifactId>
@@ -392,11 +388,6 @@
392388
<artifactId>wagon-provider-api</artifactId>
393389
<version>3.5.3</version>
394390
</dependency>
395-
<dependency>
396-
<groupId>org.apache.maven.doxia</groupId>
397-
<artifactId>doxia-decoration-model</artifactId>
398-
<version>1.11.1</version>
399-
</dependency>
400391
</dependencies>
401392
</dependencyManagement>
402393

versions-enforcer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<profile>
133133
<!-- run integration tests
134134
to use this profile:
135-
or run integration tests: ./mvnw -Prun-its
135+
or run integration tests: mvn -Prun-its
136136
-->
137137
<id>run-its</id>
138138
<build>

versions-maven-plugin/pom.xml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -88,31 +88,18 @@
8888
</dependency>
8989

9090
<dependency>
91-
<groupId>org.apache.maven.reporting</groupId>
92-
<artifactId>maven-reporting-api</artifactId>
91+
<groupId>org.apache.maven.shared</groupId>
92+
<artifactId>maven-common-artifact-filters</artifactId>
9393
</dependency>
94+
9495
<dependency>
9596
<groupId>org.apache.maven.reporting</groupId>
96-
<artifactId>maven-reporting-impl</artifactId>
97-
<exclusions>
98-
<exclusion>
99-
<groupId>org.apache.maven</groupId>
100-
<artifactId>maven-artifact</artifactId>
101-
</exclusion>
102-
<exclusion>
103-
<groupId>org.apache.maven</groupId>
104-
<artifactId>maven-core</artifactId>
105-
</exclusion>
106-
<exclusion>
107-
<groupId>org.apache.maven</groupId>
108-
<artifactId>maven-plugin-api</artifactId>
109-
</exclusion>
110-
</exclusions>
97+
<artifactId>maven-reporting-api</artifactId>
11198
</dependency>
11299

113100
<dependency>
114-
<groupId>org.apache.maven.shared</groupId>
115-
<artifactId>maven-common-artifact-filters</artifactId>
101+
<groupId>org.apache.maven.reporting</groupId>
102+
<artifactId>maven-reporting-impl</artifactId>
116103
</dependency>
117104

118105
<!-- Doxia -->
@@ -125,20 +112,9 @@
125112
<artifactId>doxia-sink-api</artifactId>
126113
</dependency>
127114

128-
<!-- Doxia-sitetools -->
129115
<dependency>
130-
<groupId>org.apache.maven.doxia</groupId>
131-
<artifactId>doxia-site-renderer</artifactId>
132-
<exclusions>
133-
<exclusion>
134-
<groupId>org.apache.maven</groupId>
135-
<artifactId>maven-artifact</artifactId>
136-
</exclusion>
137-
<exclusion>
138-
<groupId>xml-apis</groupId>
139-
<artifactId>xml-apis</artifactId>
140-
</exclusion>
141-
</exclusions>
116+
<groupId>org.codehaus.plexus</groupId>
117+
<artifactId>plexus-i18n</artifactId>
142118
</dependency>
143119

144120
<dependency>
@@ -326,7 +302,7 @@
326302
<profile>
327303
<!-- run integration tests
328304
to use this profile:
329-
or run integration tests: ./mvnw -Prun-its
305+
or run integration tests: mvn -Prun-its
330306
-->
331307
<id>run-its</id>
332308
<build>

versions-maven-plugin/src/it/it-823-ranges-update-report-001/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
propertyUpdatesReport = new File( basedir, "target/site/property-updates-report.html" ).text
2+
propertyUpdatesReport = new File( basedir, "target/reports/property-updates-report.html" ).text
33
.replaceAll( '<[^>]+>', ' ' )
44
.replaceAll( '&[^;]+;', ' ' )
55
.replaceAll( '\\s+', ' ' )
@@ -12,7 +12,7 @@ assert propertyUpdatesReport =~ / \[1\.1\.2,3\.0\] 1\.1\.3 1\.3 3/
1212
assert propertyUpdatesReport =~ /Newer versions 1\.1\.3 Latest Incremental/
1313
assert propertyUpdatesReport =~ /\b1\.2\.2 1\.3 Latest Minor 2\.0 2\.1 3\.0\b/
1414

15-
dependencyUpdatesReport = new File( basedir, "target/site/dependency-updates-report.html" ).text
15+
dependencyUpdatesReport = new File( basedir, "target/reports/dependency-updates-report.html" ).text
1616
.replaceAll( '<[^>]+>', ' ' )
1717
.replaceAll( '&[^;]+;', ' ' )
1818
.replaceAll( '\\s+', ' ' )

versions-maven-plugin/src/it/it-823-ranges-update-report-002/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
propertyUpdatesReport = new File( basedir, "target/site/property-updates-report.html" ).text
2+
propertyUpdatesReport = new File( basedir, "target/reports/property-updates-report.html" ).text
33
.replaceAll( '<[^>]+>', ' ' )
44
.replaceAll( '&[^;]+;', ' ' )
55
.replaceAll( '\\s+', ' ' )
@@ -12,7 +12,7 @@ assert propertyUpdatesReport =~ / \[1\.1\.2,3\.0\) 1\.1\.3 1\.3 3/
1212
assert propertyUpdatesReport =~ /Newer versions 1\.1\.3 Latest Incremental/
1313
assert propertyUpdatesReport =~ /\b1\.2\.2 1\.3 Latest Minor 2\.0 2\.1 \* 3\.0\b/
1414

15-
dependencyUpdatesReport = new File( basedir, "target/site/dependency-updates-report.html" ).text
15+
dependencyUpdatesReport = new File( basedir, "target/reports/dependency-updates-report.html" ).text
1616
.replaceAll( '<[^>]+>', ' ' )
1717
.replaceAll( '&[^;]+;', ' ' )
1818
.replaceAll( '\\s+', ' ' )

versions-maven-plugin/src/it/it-abstract-versions-report-001/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dependencyUpdatesReport = new File( basedir, "target/site/dependency-updates-report.html" ).text
1+
dependencyUpdatesReport = new File( basedir, "target/reports/dependency-updates-report.html" ).text
22
.replaceAll( '<[^>]+>', ' ' )
33
.replaceAll( '&[^;]+;', ' ' )
44
.replaceAll( '\\s+', ' ' )
@@ -7,7 +7,7 @@ dependencyUpdatesReport = new File( basedir, "target/site/dependency-updates-rep
77
assert dependencyUpdatesReport =~ /\b1\.1\.0-2\b/ // current version of the dependency
88
assert dependencyUpdatesReport =~ /\b3\.0\b/ // latest major available version
99

10-
pluginUpdatesReport = new File( basedir, "target/site/plugin-updates-report.html" ).text
10+
pluginUpdatesReport = new File( basedir, "target/reports/plugin-updates-report.html" ).text
1111
.replaceAll( '<[^>]+>', ' ' )
1212
.replaceAll( '&[^;]+;', ' ' )
1313
.replaceAll( '\\s+', ' ' )

versions-maven-plugin/src/it/it-aggregate-plugn-multiple-versions-same-plugin/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
* under the License.
1818
*/
1919

20-
def dependenciesUpgradeReport = new File( basedir, 'target/site/dependency-updates-aggregate-report.html')
20+
def dependenciesUpgradeReport = new File( basedir, 'target/reports/dependency-updates-aggregate-report.html')
2121

2222
assert dependenciesUpgradeReport.exists()
2323

24-
def pluginsUpgradeReport = new File( basedir, 'target/site/dependency-updates-aggregate-report.html')
24+
def pluginsUpgradeReport = new File( basedir, 'target/reports/dependency-updates-aggregate-report.html')
2525

2626
assert pluginsUpgradeReport.exists()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
output = new File( basedir, "target/site/dependency-updates-report.html" ).text
1+
output = new File( basedir, "target/reports/dependency-updates-report.html" ).text
22
assert ! ( output =~ /\b3.0\b/ )

versions-maven-plugin/src/it/it-display-parent-updates-no-updates/invoker.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
# under the License.
1818
#
1919

20-
invoker.goals = ${project.groupId}:${project.artifactId}:2.13.0:display-parent-updates
20+
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:display-parent-updates
2121
invoker.mavenOpts = -Dversions.outputFile=./output.txt -DoutputEncoding=UTF-8

versions-maven-plugin/src/it/it-plugin-updates-report-issue-684-001/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
output = new File( basedir, 'target/site/plugin-updates-report.html' ).text
1+
output = new File( basedir, 'target/reports/plugin-updates-report.html' ).text
22
.replaceAll( '<[^>]+>', ' ' )
33
.replaceAll( '&[^;]+;', ' ' )
44
.replaceAll( '\\s+', ' ' )

versions-maven-plugin/src/it/it-property-updates-report-issue-684-001/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
output = new File( basedir, 'target/site/plugin-updates-report.html' ).text
1+
output = new File( basedir, 'target/reports/plugin-updates-report.html' ).text
22
.replaceAll( '<[^>]+>', ' ' )
33
.replaceAll( '&[^;]+;', ' ' )
44
.replaceAll( '\\s+', ' ' )
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/**
5656
* Generates a report of available updates for the dependencies of a project.
5757
*/
58-
public abstract class AbstractDependencyUpdatesReportMojo extends AbstractVersionsReport<DependencyUpdatesModel> {
58+
public abstract class AbstractDependencyUpdatesReport extends AbstractVersionsReport<DependencyUpdatesModel> {
5959

6060
private static final DependencyComparator DEPENDENCY_COMPARATOR = DependencyComparator.INSTANCE;
6161

@@ -103,7 +103,7 @@ public abstract class AbstractDependencyUpdatesReportMojo extends AbstractVersio
103103
@Parameter(property = "onlyUpgradable", defaultValue = "false")
104104
protected boolean onlyUpgradable;
105105

106-
public AbstractDependencyUpdatesReportMojo(
106+
protected AbstractDependencyUpdatesReport(
107107
I18N i18n,
108108
ArtifactHandlerManager artifactHandlerManager,
109109
RepositorySystem repositorySystem,
@@ -115,13 +115,15 @@ public AbstractDependencyUpdatesReportMojo(
115115
/**
116116
* {@inheritDoc}
117117
*/
118+
@Override
118119
public boolean isExternalReport() {
119120
return false;
120121
}
121122

122123
/**
123124
* {@inheritDoc}
124125
*/
126+
@Override
125127
public boolean canGenerateReport() {
126128
return true;
127129
}
@@ -132,7 +134,7 @@ public boolean canGenerateReport() {
132134
* @param locale the locale to generate the report for.
133135
* @param sink the report formatting tool
134136
*/
135-
@SuppressWarnings("deprecation")
137+
@Override
136138
protected void doGenerateReport(Locale locale, Sink sink) throws MavenReportException {
137139

138140
Set<Dependency> dependencies = getDependencies();
@@ -188,7 +190,7 @@ protected void doGenerateReport(Locale locale, Sink sink) throws MavenReportExce
188190
}
189191

190192
protected void handleDependencyManagementTransitive(
191-
MavenProject project, Set<Dependency> dependencyManagementCollector) throws MavenReportException {
193+
MavenProject project, Set<Dependency> dependencyManagementCollector) {
192194
if (processDependencyManagementTransitive) {
193195
if (hasDependencyManagement(project)) {
194196
if (getLog().isDebugEnabled()) {
@@ -242,7 +244,7 @@ private Set<Dependency> getDependencies() {
242244
}
243245

244246
/**
245-
* Implementations of {@link AbstractDependencyUpdatesReportMojo} may use this to supply the main processing logic
247+
* Implementations of {@link AbstractDependencyUpdatesReport} may use this to supply the main processing logic
246248
* (see {@link #getDependencyManagement(Set)}) with desired dependency data, which will be used
247249
* in the creation of the report.
248250
*
@@ -266,7 +268,7 @@ private Set<Dependency> getDependencyManagement(Set<Dependency> dependencies) th
266268
}
267269

268270
/**
269-
* Implementations of {@link AbstractDependencyUpdatesReportMojo} may use this to supply the main processing logic
271+
* Implementations of {@link AbstractDependencyUpdatesReport} may use this to supply the main processing logic
270272
* (see {@link #getDependencyManagement(Set)}) with desired managed dependencies data, which will be used
271273
* in the creation of the report.
272274
*
@@ -283,7 +285,7 @@ private void renderReport(Locale locale, Sink sink, DependencyUpdatesModel model
283285
for (String format : formats) {
284286
if ("html".equals(format)) {
285287
rendererFactory
286-
.createReportRenderer(getOutputName(), sink, locale, model, allowSnapshots)
288+
.createReportRenderer(getOutputPath(), sink, locale, model, allowSnapshots)
287289
.render();
288290
} else if ("xml".equals(format)) {
289291
Path outputDir = Paths.get(getProject().getBuild().getDirectory());
@@ -294,7 +296,7 @@ private void renderReport(Locale locale, Sink sink, DependencyUpdatesModel model
294296
throw new MavenReportException("Could not create the output directory");
295297
}
296298
}
297-
Path outputFile = outputDir.resolve(getOutputName() + ".xml");
299+
Path outputFile = outputDir.resolve(getOutputPath() + ".xml");
298300
new DependencyUpdatesXmlReportRenderer(model, outputFile, allowSnapshots).render();
299301
}
300302
}
@@ -322,11 +324,4 @@ protected boolean hasDependencyManagement(MavenProject project) {
322324
return project.getDependencyManagement() != null
323325
&& project.getDependencyManagement().getDependencies() != null;
324326
}
325-
326-
/**
327-
* {@inheritDoc}
328-
*/
329-
public String getOutputName() {
330-
return "dependency-updates-report";
331-
}
332327
}

0 commit comments

Comments
 (0)