Skip to content

[4.0.x] Bump Sisu to 1.1.0 and fix extension realm visibility for JSR330 filtering - #12556

Merged
gnodet merged 3 commits into
maven-4.0.xfrom
backport/sisu-1.1.0-realm-visibility-4.0.x
Jul 28, 2026
Merged

[4.0.x] Bump Sisu to 1.1.0 and fix extension realm visibility for JSR330 filtering#12556
gnodet merged 3 commits into
maven-4.0.xfrom
backport/sisu-1.1.0-realm-visibility-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12554 to maven-4.0.x.

  • Bumps Eclipse Sisu from 1.0.1 to 1.1.0
  • Fixes extension realm visibility so that Sisu 1.1.0's new JSR330 bean filtering works correctly with Maven's ClassRealm hierarchy

Root Cause

Sisu 1.1.0 introduces jsr330ComponentVisibilityFollowsPlexusVisibility (on by default), which filters beans based on ClassRealm visibility via RealmManager.computeVisibleNames(). This BFS traversal walks parent and import realms from the current TCCL.

Extension realms have plexus.core as their parent, but beans discovered in the container are sourced from the maven.ext realm. Since extension realms had no import relationship to maven.ext, container-sourced beans were incorrectly filtered out when TCCL was set to an extension realm during lifecycle callbacks (e.g., Mimir extension).

Fix

Adds a reverse import from each extension realm to the container realm (maven.ext), using the same importFrom(realm, realm.getId()) pattern already used for the forward direction. This works with Sisu 1.1.0's filtering feature — the realm visibility graph is corrected to reflect the actual relationship between extension and container realms.

Verified

  • ✅ Clean cherry-pick from master (no conflicts)
  • mvn clean install -DskipTests passes on 4.0.x
  • mvn verify -pl impl/maven-cli passes (581 tests, 0 failures)
  • ✅ Build succeeds with Mimir extension enabled
  • CI build passes

🤖 Generated with Claude Code

…ering

Sisu 1.1.0 adds JSR330 bean visibility filtering based on ClassRealm
hierarchy (jsr330ComponentVisibilityFollowsPlexusVisibility, on by default).
When TCCL is an extension realm during lifecycle callbacks, Sisu's
FilteredBeans calls RealmManager.computeVisibleNames() which traverses
parent and import realms via BFS. Extension realms have plexus.core as
parent but beans discovered in the container are sourced from the
maven.ext realm. Since extension realms had no import relationship
to maven.ext, container-sourced beans were incorrectly filtered out.

This caused failures with extensions like Mimir that register lifecycle
listeners: when the listener's callback triggered a Sisu dynamic map
access (e.g., NameMapper resolution), the beans were invisible from
the extension's realm, resulting in "Unknown NameMapper name" errors.

The fix adds a reverse import from each extension realm to the container
realm (maven.ext), following the same pattern already used for the
forward direction (maven.ext imports from extension realms). This
makes maven.ext reachable in Sisu's visibility BFS traversal, so
container-sourced beans remain visible regardless of TCCL context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jul 27, 2026
@gnodet gnodet added dependencies Pull requests that update a dependency file mvn40 labels Jul 28, 2026
@gnodet
gnodet marked this pull request as ready for review July 28, 2026 07:05

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Clean cherry-pick backport of #12554 to maven-4.0.x. The diff is byte-identical to the master PR.

Sisu 1.1.0 bump — straightforward version update.

Realm visibility fix — the new reverse import (realm.importFrom(extRealm, extRealm.getId())) correctly makes container-sourced beans visible from extension realms. Key observations:

  • Correctly placed outside the if (exportedPackages.isEmpty()) guard — all extensions need container bean visibility regardless of export config
  • No circular import risk: ClassRealm imports are non-transitive directional lookups, and Sisu's BFS uses a visited set
  • All 24 CI checks pass green across all platforms and JDK versions

Minor note (non-blocking): No dedicated test for the reverse import behavior — it's validated by the full integration suite (581+ tests), but a targeted test would guard against future regressions if realm setup is refactored.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New commit adds the same regression IT (MavenITgh12522NonExtensionPluginTest) as the master PR — verifying non-extension plugins with JSR330 components don't break builds. Good backport of the test. Prior APPROVE still stands.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

gnodet added a commit to gnodet/maven that referenced this pull request Jul 28, 2026
Regression test verifying that plugins NOT marked with
<extensions>true</extensions> do not cause build failures when they
ship JSR330 components whose internal dependencies cannot be resolved
in Maven's container. Uses tycho-bnd-plugin as the reproducer.

With Sisu 1.1.0's jsr330ComponentVisibilityFollowsPlexusVisibility,
non-extension plugin components are filtered out of container-realm
JSR330 lookups, preventing the provisioning error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the backport/sisu-1.1.0-realm-visibility-4.0.x branch from 48e139f to 86c1337 Compare July 28, 2026 10:20
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet merged commit aace35a into maven-4.0.x Jul 28, 2026
23 checks passed
@gnodet
gnodet deleted the backport/sisu-1.1.0-realm-visibility-4.0.x branch July 28, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file mvn40

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants