Skip to content

ATLAS-5432: Fix Enunciate JDK 8 build failure - #788

Merged
mandarambawane merged 4 commits into
apache:masterfrom
bhor-sanket:ATLAS-5432
Oct 22, 2026
Merged

mandarambawane merged 4 commits into
apache:masterfrom
bhor-sanket:ATLAS-5432

Conversation

@bhor-sanket

@bhor-sanket bhor-sanket commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Background :

The Atlas CI pipeline (ci.yml) runs a build matrix across JDK 8 and JDK 17 using GitHub Actions ubuntu-22.04 runners. The ubuntu-22.04 label is a floating image tag — GitHub auto-rolls the underlying VM image weekly, including all pre-installed tools. Atlas does not control its Maven version (no Maven wrapper, no actions/setup-maven step) — Maven comes entirely from the runner image.

The runner image ubuntu22/20261004.315 silently upgraded Maven from 3.9.16 to 3.10.0. Maven 3.10.0 ships Maven Resolver 2.x (up from Resolver 1.x in 3.9.16), which introduces stricter handling of system-scoped dependencies. Starting all JDK 8 CI builds began failing with zero code changes to the repository.

Problem Statement :

  • Existing behavior: JDK 8 CI builds fail during the Enunciate documentation generation phase:
[ERROR] Failed to execute goal com.webcohesion.enunciate:enunciate-maven-plugin:2.13.2:docs (default)
on project atlas-webapp: A required class was missing:
com/sun/tools/javac/api/JavacTool
  • Expected behavior: JDK 8 builds should complete successfully, generating Swagger/OpenAPI documentation via Enunciate.

  • Root cause:

    • Maven 3.10.0's Resolver 2.x actively drops system-scoped transitive dependency entries from POMs resolved from a repository
    • Enunciate 2.13.2 (used for JDK < 17) directly imports com.sun.tools.javac.api.JavacTool, an internal JDK class that lives in tools.jar. Its enunciate-javac-support module declares tools.jar as a system-scoped dependency via a profile.
    • System-scoped dependencies are not transitive in Maven. Under Resolver 1.x (Maven ≤ 3.9.x) this was a latent bug —tools.jar happened to be available on the JVM boot classpath. Under Resolver 2.x, the system-scoped entry is actively stripped, making tools.jar completely absent from the enunciate-maven-plugin classloader.
  • Why JDK 17 is NOT affected: The jdk-17 Maven profile switches to Enunciate 2.15.0, which dropped the tools.jar dependency entirely and uses javax.tools.ToolProvider.getSystemJavaCompiler() — the public standard API with no system-scoped dependencies.

  • Impact: All JDK 8 CI builds fail; JDK 17 builds were being cancelled by fail-fast: true default.

How the patch resolves it :

  • webapp/pom.xml — Added a jdk-8-enunciate profile that auto-activates for JDK < 17 ((,17)) and injects tools.jar as a plugin-level dependency on the enunciate-maven-plugin. Plugin dependencies go directly into the plugin's own classloader, bypassing both the Maven transitivity limitation and the Resolver 2.x stripping. This is the standard Maven idiom for tools.jar (same pattern used by Hadoop and Flink).
  • The profile does NOT activate on JDK 17+ (verified via mvn help:active-profiles), so Enunciate 2.15.0 builds are completely unaffected.

How was this patch tested?

Setup :

  • Local environment: macOS, Zulu JDK 8.0.482 + Zulu JDK 17.0.18 via SDKMAN, Maven 3.8.7 and Maven 3.10.0 via SDKMAN
  • Build command: mvn -pl webapp -am -Pdist -DskipTests generate-resources
  • Four combinations tested: JDK 8 with fix, JDK 8 without fix, JDK 17 with fix, JDK 17 without fix

Use-cases validation :

  • JDK 8 + Maven 3.10.0 without fix: Build fails with com/sun/tools/javac/api/JavacTool missing — confirms the bug exists.
  • JDK 8 + Maven 3.10.0 with fix: Build succeeds, Enunciate generates full API documentation.
    • 126 files generated in webapp/target/api/v2/apidocs/
    • 88 REST API endpoints documented in swagger.json
    • All resource pages generated (resource_EntityREST.html, resource_DiscoveryREST.html, resource_GlossaryREST.html, resource_LineageREST.html, resource_TypesREST.html, resource_RelationshipREST.html, etc.)
    • Swagger UI files present (index.html, swagger-ui-bundle.js, swagger-ui.css, swagger.json)
  • JDK 17 with fix vs JDK 17 without fix: Identical output structure — 126 files, 88 endpoints, same model definitions. The jdk-8-enunciate profile is correctly inactive on JDK 17.
  • Cross-combination diff (all four):
    • File counts identical across all four (126 files each)
    • REST endpoint lists identical (88 paths each)
    • Model definitions identical
    • Resource HTML page sets identical
      - Only differences are non-deterministic enum example values in HTML docs (e.g., "PURGED" vs "ACTIVE" in JSON examples), which is normal Enunciate behavior across any two builds.
  • Profile activation verified:
    • JDK 8: jdk-8 and jdk-8-enunciate both active
    • JDK 17: jdk-17 active, jdk-8-enunciate NOT active

@bhor-sanket bhor-sanket changed the title ATLAS-5432: Fix Enunciate JDK 8 build failure and enable parallel mat… ATLAS-5432: Fix Enunciate JDK 8 build failure Oct 22, 2026
@mandarambawane
mandarambawane merged commit b5faeef into apache:master Oct 22, 2026
2 checks passed
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.

4 participants