Repository navigation
feat(manager,zpm-maven-plugin): resolve zpm dependencies ahead of an offline install - #2612
Merged
Merged
Conversation
…offline install zpm install generates the delegate module's module-info with jdeps, which can only run strictly when the delegated jars' optional and provided dependencies are available. An offline install (--exclude-remote-repositories) only sees what was already copied into its local repository, and Maven never resolves optional or provided dependencies transitively, so the optional tree was incomplete and jdeps silently fell back to --ignore-missing-deps. - root the optional dependency tree at the delegated artifacts, pinned to the main resolution's versions, so provided dependencies of named modules are no longer followed - tolerate missing or invalid descriptors in the optional tree instead of dropping it entirely - add zpm resolve, which resolves main and optional dependencies into a local repository cache and exports every resolved file into a self-contained repository for a later offline install - add zpm install --strict to fail instead of falling back when the delegate module references unresolved dependencies - add build/zpm-maven-plugin with a resolve goal that renders zpm.json.template, checks its dependencies are declared by the project, and runs zpm resolve in an isolated class loader - cloud/docker-image assembles the resolved repository instead of a hand-maintained list of local repository paths Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
Exclude manager's transitive dependencies so the plugin realm carries only the shaded manager jar that the launcher loads in isolation, and regenerate the build aggregator NOTICE. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
zpm.json.template lists io.aklivity.zilla:command, which the command-* modules only depend on at provided scope, so docker-image did not resolve it. The zpm-maven-plugin resolve goal now reports such gaps. Also add the generated zpm-maven-plugin NOTICE. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
Fail the image build when a delegate module would reference unresolved dependencies instead of silently generating its module-info while ignoring them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
…itory zpmw bootstraps by copying the manager jar from the local repository, which the resolved repository did not contain because zpm itself is not a zpm.json dependency, so the offline image build failed with "Unable to access jarfile .zpm/wrapper/manager-develop-SNAPSHOT.jar". Export the manager artifact the goal runs alongside the resolved dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
maven-resolver's collector resolves artifact descriptors on a thread pool, so artifactResolved events reach ZpmCache's listener concurrently. The listener recorded the paths to export in a LinkedHashSet, which silently drops entries under concurrent adds, so zpm resolve could export an incomplete repository, e.g. without a parent POM that an offline install then needs to collect the optional tree. Record resolved paths in a concurrent set. ZpmCacheExportTest fires 16000 artifactResolved events from 8 threads; before the fix only 552-1010 files were exported. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
jfallows
added a commit
that referenced
this pull request
Sep 26, 2026
…offline install (#2612) * feat(manager,zpm-maven-plugin): resolve zpm dependencies ahead of an offline install zpm install generates the delegate module's module-info with jdeps, which can only run strictly when the delegated jars' optional and provided dependencies are available. An offline install (--exclude-remote-repositories) only sees what was already copied into its local repository, and Maven never resolves optional or provided dependencies transitively, so the optional tree was incomplete and jdeps silently fell back to --ignore-missing-deps. - root the optional dependency tree at the delegated artifacts, pinned to the main resolution's versions, so provided dependencies of named modules are no longer followed - tolerate missing or invalid descriptors in the optional tree instead of dropping it entirely - add zpm resolve, which resolves main and optional dependencies into a local repository cache and exports every resolved file into a self-contained repository for a later offline install - add zpm install --strict to fail instead of falling back when the delegate module references unresolved dependencies - add build/zpm-maven-plugin with a resolve goal that renders zpm.json.template, checks its dependencies are declared by the project, and runs zpm resolve in an isolated class loader - cloud/docker-image assembles the resolved repository instead of a hand-maintained list of local repository paths Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg * build(zpm-maven-plugin): depend on the self-contained manager jar only Exclude manager's transitive dependencies so the plugin realm carries only the shaded manager jar that the launcher loads in isolation, and regenerate the build aggregator NOTICE. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg * build(docker-image): declare command runtime dependency zpm.json.template lists io.aklivity.zilla:command, which the command-* modules only depend on at provided scope, so docker-image did not resolve it. The zpm-maven-plugin resolve goal now reports such gaps. Also add the generated zpm-maven-plugin NOTICE. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg * build(docker-image): install with zpm --strict Fail the image build when a delegate module would reference unresolved dependencies instead of silently generating its module-info while ignoring them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg * fix(zpm-maven-plugin): export the manager jar with the resolved repository zpmw bootstraps by copying the manager jar from the local repository, which the resolved repository did not contain because zpm itself is not a zpm.json dependency, so the offline image build failed with "Unable to access jarfile .zpm/wrapper/manager-develop-SNAPSHOT.jar". Export the manager artifact the goal runs alongside the resolved dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg * fix(manager): record resolved paths from concurrent resolver events maven-resolver's collector resolves artifact descriptors on a thread pool, so artifactResolved events reach ZpmCache's listener concurrently. The listener recorded the paths to export in a LinkedHashSet, which silently drops entries under concurrent adds, so zpm resolve could export an incomplete repository, e.g. without a parent POM that an offline install then needs to collect the optional tree. Record resolved paths in a concurrent set. ZpmCacheExportTest fires 16000 artifactResolved events from 8 threads; before the fix only 552-1010 files were exported. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg --------- Co-authored-by: Claude <[email protected]>
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.
Description
zpm installmerges automatic (non-modular) jars into a delegate module and generates itsmodule-infowith jdeps. jdeps can only check that module strictly when the delegated jars'<optional>andprovideddependencies are available. An offline install (--exclude-remote-repositories) only sees what was already copied into its local repository. Maven never resolves optional or provided dependencies transitively, so that tree was always incomplete:providededges out of named modules (e.g.binding-http→binding-http.spec) and aborted on the first missing POM (resolved 0 optional dependencies).--ignore-missing-deps, so the strict check quietly stopped checking.dependency:go-offlinefollows optionals but notprovided, and aborts on unresolvable classifiers.dependency:getonly takes root-level optionals.go-offline-maven-plugintakes neither.manager (zpm)
provided/optional edges out of named modules are never followed. Group ids aren't special-cased.SimpleArtifactDescriptorPolicy(true, true)), so one missing POM no longer drops the whole tree.zpm resolve. It runs the same resolution and module classification asinstall, using a local Maven repository as its cache (--local-repository, reused across runs). It then exports every file it resolved, including jars, POMs, parent POMs and imported BOMs, into--repository-directory. That directory is a self-contained repository for a later offlineinstall.aether.dependencyCollector.bf.threads), soartifactResolvedevents arrive concurrently. The paths to export are recorded in a concurrent set. With the unsynchronized set, an export could silently miss files. One CI run exported a repository withoutjavaee-api's parent POMs, and the offlineinstall --strictthen collected no optional dependencies.zpm install --strict. It fails with the unresolved references instead of falling back. Default behaviour is unchanged.simplelocal repository layout, so artifacts are reused regardless of which repository id originally provided them.ZpmInstallintoZpmDependencyCommand.build/zpm-maven-plugin (new)
resolve, default phaseprepare-package.zpm.json.templatewith${KEY}properties.zpm resolveinto${project.build.directory}/zpm/repository, and honours-o.managerjar into the same repository, so the image'szpmwcan bootstrap from it.managerjar from its own class loader, and depends on it without transitive dependencies.cloud/docker-image
zpm-maven-plugin:resolve, andassembly.xmlnow copies only the resolved repository. The hand-maintained local-repository include list is gone.--strictin both Dockerfiles. BothDockerfileandalpine.Dockerfilenow runzpmw installwith--strict. zilla links no delegate module today, so this changes nothing yet. It enforces the invariant from now on: an image never ships a delegate module whosemodule-infowas generated while ignoring unresolved references.commanddependency. It declares thecommanddependency, which the new check flagged: it was listed inzpm.json.templatebut only reachable atprovidedscope.Tests
ZpmCacheOptionalTest. The optional tree follows optional andprovideddependencies of delegated artifacts, not those of named modules. A missing optional POM gives a partial tree, and the test fails without the descriptor policy. The exported repository is self-contained.ZpmCacheExportTest. It fires 16,000artifactResolvedevents from 8 threads and checks that every file is exported. Before the fix, only 552–1,010 files were exported (three runs). Single-threaded, all were exported.ZpmResolveTest. It exports main and optional dependencies, and re-exports from the local repository cache after the export and the remote are removed.ZpmInstallStrictTest.--strictfails when the delegate references a class that isn't resolvable.ZpmTemplateTest,ResolveMojoTest(skip, undeclared dependency, argument construction including offline, manager jar export) andZpmLauncherTest(isolation, failure cause propagation).Verification
./mvnw clean install -pl manager,build/zpm-maven-pluginpasses, coverage checks met, no checkstyle violations../mvnw package -pl cloud/docker-image -Ddocker.skipresolved 428 dependencies and exported them.java -Duser.home=<dir containing only the export as .m2/repository> -jar manager.jar install --debug --instrument --exclude-remote-repositories --strictresolved all 428 and linked the runtime image. These are the same flags as the updatedDockerfile.javaee-api's parent POMs from an otherwise complete export. The offlineinstall --strictthen failed with the message from that CI run:Failed to collect dependencies at commons-logging:commons-logging:jar:1.2 -> log4j:log4j:jar:1.2.17 -> org.apache.openejb:javaee-api:jar:5.0-2, followed byresolved 0 optional dependencies.Dockerfile: built via./mvnw install -pl cloud/docker-imagefrom the resolved repository only, and the image runs.alpine.Dockerfile: built from the same assembled context: 428 dependencies resolved offline and linked with--strict;zilla versionprintsdevelop-SNAPSHOT.🤖 Generated with Claude Code
https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg