Skip to content

fix: make javadoc:javadoc succeed on the forked OpenSearch tree - #44

Merged
marevol merged 1 commit into
mainfrom
fix/javadoc-opensearch-tags
Sep 13, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/javadoc-opensearch-tags

Conversation

@marevol

@marevol marevol commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

mvn javadoc:javadoc has been failing since the fork landed:

[ERROR] .../opensearch/core/common/io/stream/StreamOutput.java:101: error: unknown tag: opensearch.api

Two causes, both introduced by importing the OpenSearch tree.

Custom block tags

OpenSearch marks every class with @opensearch.api, @opensearch.internal or
@opensearch.experimental and declares them in its own javadoc configuration. The
fork brought 1,820 of them and no declaration, so javadoc rejected each one.

They are declared now in a pluginManagement entry for maven-javadoc-plugin, which
the release profile's attach-javadocs execution inherits — previously that
execution carried its own copy of the version and encoding settings, and the plain
javadoc:javadoc goal saw no configuration at all. The tags render as ordinary
block headings (1,684 in the generated HTML).

Stripping the tags from the sources was the alternative; declaring them is twelve
lines of pom against edits in 600+ files, and the stability level they record is
real information.

References the pruning removed

201 {@link} / @see targets no longer exist — Requests#indexRequest(String),
BulkRequest#add(DocWriteRequest), WeightedRoutingService, RoutingNodes#failShard
and so on. javadoc reports each as reference not found, and stops at 100, so the
first run only showed part of it.

Each was rewritten at the exact position javadoc reported:

  • {@link X} to {@code X} where the member or class was pruned. The prose still
    names what it named; it just no longer claims to link to it.
  • @see X lines dropped, since @see cannot hold a non-reference.

Three sites needed a judgement call rather than a substitution:

  • ClusterBlocks — a javadoc block for a removed method was left attached to
    toString(), documenting an indices parameter that method does not have. Deleted.
  • Provider#get() — @throws OutOfScopeException / @throws ProvisionException for
    two exception types the fork does not contain. Kept as prose in the description so
    the contract survives.
  • NativeMemoryUsageCalculator — a {@link} split across two lines, which the
    positional rewrite could not handle.

All of it is inside comments; git diff on the source tree touches no code.

Verification

mvn javadoc:javadoc BUILD SUCCESS, 0 errors (was 100 errors, capped)
mvn -Prelease javadoc:jar BUILD SUCCESS
mvn test 636 tests, 0 failures — OpenSearch 3/2/1 and Elasticsearch 8/7 containers included

12,486 javadoc warnings remain, almost all "no @PARAM for <T>" in the imported
tree. They do not fail the build and are upstream's, not introduced here.

The fork brought upstream's three custom block tags and a set of javadoc
references whose targets the pruning removed, so `mvn javadoc:javadoc` failed
with "unknown tag: opensearch.api" and "reference not found".

- Declare `@opensearch.api`, `@opensearch.internal` and `@opensearch.experimental`
  in a `pluginManagement` entry for maven-javadoc-plugin, so both the plain goal
  and the release profile's `attach-javadocs` see them. 1,820 occurrences across
  the forked tree; they render as ordinary block tags.
- Rewrite the 201 references that no longer resolve: `{@link X}` to `{@code X}`
  where the member or class was pruned, and drop `@see` lines whose only target
  is gone. Comment-only; no production code changes.
- Three sites needed more than that: an orphaned javadoc block left on
  `ClusterBlocks#toString()` by a removed method, `Provider#get()`'s `@throws`
  clauses for two exception types that are not in the fork (kept as prose), and a
  link split across two lines in `NativeMemoryUsageCalculator`.

`mvn javadoc:javadoc` and `mvn -Prelease javadoc:jar` both succeed; 636 tests pass.
@marevol
marevol merged commit bd2f0ef into main Sep 13, 2026
1 check passed
marevol added a commit that referenced this pull request Sep 14, 2026
…#45)

#44 removed the javadoc errors but left 12,486 warnings, all of them from
doclint's `missing` group: 6,744 "no comment", 2,332 "no @return", and
@param/@throws gaps throughout the imported OpenSearch tree. That is upstream's
documentation coverage, not a defect introduced here, and it buries anything worth
reading in the build output.

Set `doclint` to `all,-missing`, so the groups that catch real breakage - syntax,
HTML, accessibility and references - still fail the build, while completeness is
left alone. It also pins behaviour that otherwise depends on the JDK in use.

`mvn javadoc:javadoc` and `mvn -Prelease javadoc:jar` now report 0 errors and
0 warnings, and still generate all 4,902 pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant