Use systemPath for system-scoped dependencies instead of remote resolution (#27) - #148
Merged
tgodzik merged 1 commit intoJun 16, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #27
Problem
When a dependency has
<scope>system</scope>(with a<systemPath>), the plugin tried to resolve it from remote Maven repositories. Since system-scoped jars live on the local filesystem and aren't published to any repo, this produced spuriousDownloading from central: …attempts and[ERROR] FAILURE …:system/Could not resolve …:systemlog lines — the symptom reported in #27 (e.g.jdk.tools:jdk.tools:1.8pulled in transitively byhadoop-annotationson Java 8).Fix
In
MojoImplementation, when building the resolution modules, branch on scope: forArtifact.SCOPE_SYSTEM, use the file Maven already set from<systemPath>instead of issuing a remoteArtifactRequest. If that file is genuinely absent (e.g.tools.jaron JDK 11+), the artifact is skipped with a warning rather than aborting the wholebloopInstall(the dependency was never resolvable anyway). The compile/runtime classpath is unaffected — it still comes from Maven's owngetCompileClasspathElements(), which already includes the system jar for the module that declares it.Notes
try/catchinresolveArtifactalready prevented a hard crash by swallowing the failed remote fetch; this change removes the wasted remote round-trips and the misleading error logging, and uses the provided path as intended.