GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Keep verbatim blocks working with Doxia 1 by slachiewicz · Pull Request #243 · apache/maven-reporting-impl

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Aug 8, 2026

Copy link
Copy Markdown
Member

Fixes the NoSuchMethodError reported in apache/maven-project-info-reports-plugin#103, which silently truncates five MPIR reports (dependency-info, ci-management, issue-management, licenses, scm) while the build still says SUCCESS.

Why it happens

A report plugin never runs against its own Doxia. DefaultMavenReportExecutor in maven-reporting-exec imports org.apache.maven.doxia.sink (as a prefix, so .impl too) from the Maven Site Plugin realm into the report plugin realm, and excludes doxia-sink-api from the report plugin's own dependency resolution. Whatever Doxia the site plugin ships is what the report gets.

Sink.verbatim() with no argument was only added in Doxia 2. Doxia 1 has verbatim(boolean), verbatim(SinkEventAttributes) and verbatim_(). So as soon as a report plugin picks up maven-reporting-impl 4.x and is rendered by a Maven Site Plugin older than 3.21.0, verbatimText/verbatimLink blow up. Maven 3.9.x still binds maven-site-plugin 3.12.1 (Doxia 1.11.1) by default, so users hit this without doing anything unusual.

The change

Call verbatim(SinkEventAttributes) instead, which exists in both Doxia 1 and Doxia 2. Passing null is safe on either: Doxia 1's Xhtml5BaseSink.verbatim runs the argument through SinkUtils.filterAttributes, which returns null for null and is then replaced by an empty attribute set.

This is the only Doxia 2 only Sink method reached on the generate(Sink, Locale) path. I checked every sink. call in this component against both Doxia branches: tableRows(int[], boolean), section, sectionTitle, anchor, link, text and rawText all exist in Doxia 1 as well. AbstractMavenReport's Doxia 2 only imports (DocumentRenderingContext, SiteModel, SiteRendererSink) are confined to the standalone execute() path, where the site plugin realm is not involved.

Verification

Built this branch plus MPIR against it and ran mvn site on a small project:

  • maven-site-plugin 3.12.1 (Doxia 1.11.1): before, NoSuchMethodError and truncated reports; after, complete reports with the verbatim blocks rendered.
  • maven-site-plugin 3.21.0 (Doxia 2.0.0): unchanged, complete reports before and after.

The added unit test drives verbatimText and verbatimLink through a Sink proxy that fails on the no argument overload. It fails without the production change. A dynamic proxy is used rather than a SinkAdapter subclass because AbstractSink.verbatim() is final and delegates to the attribute taking overload, which would mask the distinction.

Not addressed here

verbatimSource still uses SinkEventAttributeSet.SOURCE, which is named BOXED in Doxia 1 and would fail the same way with a NoSuchFieldError. MPIR does not call it, so it is out of scope for this fix, but it is the other half of MSHARED-1364 and worth a follow up.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slachiewicz
Keep verbatim blocks working with Doxia 1
f6a0768
Sink.verbatim() was only added in Doxia 2, but a report plugin never runs
against its own Doxia: DefaultMavenReportExecutor imports the
org.apache.maven.doxia.sink package from the Maven Site Plugin realm into
the report plugin realm and excludes doxia-sink-api from the report
plugin's own dependencies. So with any Maven Site Plugin older than
3.21.0, and that is still the version Maven 3.9.x binds by default, the
call ends in NoSuchMethodError and the report is silently cut short.

Use verbatim(SinkEventAttributes) instead, which exists in Doxia 1 and 2
alike and is null safe in both.
@slachiewicz slachiewicz added bug Something isn't working maintenance labels Aug 8, 2026
@slachiewicz
slachiewicz merged commit 736415f into apache:master Aug 8, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 4.0.1 milestone Aug 8, 2026
@github-actions github-actions Bot assigned slachiewicz Aug 8, 2026
This was referenced Aug 8, 2026
NoSuchMethodError: 'void org.apache.maven.doxia.sink.Sink.verbatim()' apache/maven-project-info-reports-plugin#103
Open
Document which Maven Site Plugin version the reports need apache/maven-project-info-reports-plugin#649
Merged
[MSHARED-1364] AbstractMavenReportRenderer should not depend on Doxia impl classes #184
Open
Keep verbatim source blocks working with Doxia 1 #245
Merged
@slachiewicz
slachiewicz deleted the doxia1-compatible-verbatim branch September 19, 2026 22:32
@patpatpat123 patpatpat123 mentioned this pull request Nov 15, 2026
Keep reports complete when the Site Plugin provides Doxia 1 apache/maven-project-info-reports-plugin#698
Open
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@slachiewicz slachiewicz

Labels

bug Something isn't working maintenance

Projects

None yet

Milestone

4.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@slachiewicz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.