arturobernalg commented on PR #13727: URL: https://github.com/apache/maven/pull/13727#issuecomment-6442006609
@slawekjaranowski you were right, I was missing something. I checked `maven-jline`'s `Ansi.java` and confirmed it exists specifically to forward JAnsi API calls to the already-initialized JLine terminal for `maven-shared-utils` compatibility -- removing the `exportedPackage` entry would have cut that path. I then checked how plexus-classworlds actually resolves an import: `SelfFirstStrategy`/`ParentFirstStrategy.loadClass()` call `loadClassFromImport()` first, and when that throws `ClassNotFoundException` in the imported realm, they fall back to `loadClassFromSelf()` -- the plugin's own classpath. So the `exportedPackage: org.fusesource.jansi.*` import only "wins" for `Ansi` (the one class `maven-jline` ships); any other class in that package a plugin needs, like `AnsiConsole`, which `maven-jline` doesn't provide, falls through to the plugin's own copy. That import was never the cause of #13726. The actual bug is the `exportedArtifact` entry: `DefaultArtifactFilterManager` uses it as a dependency-resolution-time exclusion (`DefaultClassRealmManager`'s `providedArtifacts`), so the real `org.fusesource.jansi:jansi` artifact never gets added to a plugin's resolved classpath at all -- the plugin has no copy to fall back to for `AnsiConsole`, regardless of the package import. That's the only entry I'm now removing. Pushed 427555f: restored `exportedPackage`, kept the `exportedArtifact` removal, narrowed the test to match, re-ran the full suite + checkstyle + spotless. Thanks for catching this before it merged. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
