Skip to content

feat(manager): Maven repository ids and resolver configuration for zpm - #2614

Merged
jfallows merged 2 commits into
developfrom
claude/friendly-bohr-kfi9h0
Sep 26, 2026
Merged

jfallows merged 2 commits into
developfrom
claude/friendly-bohr-kfi9h0

Conversation

@jfallows

@jfallows jfallows commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

zpm's repository handling couldn't share configuration with a Maven build of the same repositories:

  • Settings fixed. It built its maven-resolver sessions from its own fixed settings only, so standard maven-resolver configuration (for example a remote repository group-id filter) had no effect.
  • No repository ids. zpm.json listed repositories as bare URLs. zpm derived each repository's id from its host, and that host was also the key for the repository's settings.xml server and for any per-repository resolver configuration.

As a result, zpm requested every artifact from each repository in turn, and an unreachable repository cost a 10s connect timeout per uncached artifact.

manager (zpm)

  • -Daether.* system properties are applied to zpm's resolver sessions, the same way Maven passes -D properties to its resolver.
    • They're applied before zpm's own settings, so zpm's noop sync-context factory and bounded timeouts still take precedence.
    • When zpm runs inside Maven through zpm-maven-plugin, it shares Maven's JVM system properties, so .mvn/maven.config applies to zpm resolve as well. Maven sets them with ${session.rootDirectory} already interpolated.
  • Named repositories in zpm.json. repositories may now be an object mapping each repository id to its URL, in resolution order:
    "repositories":
    {
      "github": "https://maven.packages.aklivity.io/",
      "central": "https://repo.maven.apache.org/maven2/"
    }
    • The id names the remote repository and selects its settings.xml server, as in Maven.
    • The array form is still accepted, with the host as the id, as before.

cloud/docker-image

  • zpm.json.template names its repositories github and central. The existing .mvn/rrf/groupId-github.txt therefore covers zpm too, and no host-named filter file is needed.

Tests

  • ZpmCacheRepositoryFilterTest. A counting HTTP repository is listed first and filtered to another group; the artifact lives in a second, file-based repository.
    • With the filter properties set, the artifact resolves and the filtered repository gets 0 requests. Before the change it got 2.
    • Without them, the filtered repository is still asked.
  • ZpmConfigurationTest. The object form reads in declaration order and writes back as an object. The existing array and empty-list cases are unchanged.
  • ZpmDependencyCommandTest. A named repository takes its id and its matching settings.xml server's credentials. An array entry still takes its host as the id.
  • Test-first. All three new cases failed before the implementation, and the 14 existing configuration tests kept passing.

Verification

  • Local build. ./mvnw clean install -pl manager passes: 33 tests, checkstyle, license and coverage.
  • Through Maven. ./mvnw package -pl cloud/docker-image -Ddocker.skip renders the object-form template and zpm-maven-plugin resolves all 428 dependencies.
  • Filter effect. I ran zpm resolve on that rendered zpm.json with a local repository holding only io/aklivity, so every third-party artifact had to be downloaded:
third-party requests to maven.packages.aklivity.io resolve 428 dependencies
no -Daether.* 149 9.2s
.mvn/maven.config's filter properties, groupId-github.txt only 0 3.1s

Fixes # (none)

🤖 Generated with Claude Code

https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg

…m properties

zpm built its resolver sessions from its own fixed settings only, so
standard maven-resolver configuration had no effect on it. In particular
a remote repository group-id filter (aether.remoteRepositoryFilter.groupId)
could not stop zpm from requesting every artifact from each configured
repository in turn, and an unreachable repository then cost a connect
timeout per uncached artifact.

zpm now copies -Daether.* system properties into its resolver sessions,
as Maven does, before its own settings. When zpm runs inside Maven via
zpm-maven-plugin it inherits Maven's -D properties, including those from
.mvn/maven.config.

zpm names remote repositories after their host, so this repository adds
a group-id filter file for maven.packages.aklivity.io alongside the one
for Maven's github repository id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
zpm.json listed repositories as bare URLs, so zpm had no repository id
to use and derived one from each URL's host. That host was also the key
for the settings.xml server holding the repository's credentials, and
for any maven-resolver per-repository configuration such as a group-id
filter file, so neither could be shared with a Maven build of the same
repositories.

zpm.json repositories may now be an object mapping each repository id
to its URL, in resolution order. The id names the remote repository and
selects its settings.xml server, as in Maven. The array form is still
accepted, with the host as the id, as before.

cloud/docker-image names its repositories github and central, so the
group-id filter file for github covers zpm too and the host-named copy
is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg
@jfallows jfallows changed the title feat(manager): apply maven-resolver configuration from aether.* system properties feat(manager): Maven repository ids and resolver configuration for zpm Sep 26, 2026

@jfallows jfallows 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.

LGTM

@jfallows
jfallows merged commit 312772e into develop Sep 26, 2026
44 checks passed
jfallows added a commit that referenced this pull request Sep 26, 2026
#2614)

* feat(manager): apply maven-resolver configuration from aether.* system properties

zpm built its resolver sessions from its own fixed settings only, so
standard maven-resolver configuration had no effect on it. In particular
a remote repository group-id filter (aether.remoteRepositoryFilter.groupId)
could not stop zpm from requesting every artifact from each configured
repository in turn, and an unreachable repository then cost a connect
timeout per uncached artifact.

zpm now copies -Daether.* system properties into its resolver sessions,
as Maven does, before its own settings. When zpm runs inside Maven via
zpm-maven-plugin it inherits Maven's -D properties, including those from
.mvn/maven.config.

zpm names remote repositories after their host, so this repository adds
a group-id filter file for maven.packages.aklivity.io alongside the one
for Maven's github repository id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg

* feat(manager): name zpm.json repositories with Maven repository ids

zpm.json listed repositories as bare URLs, so zpm had no repository id
to use and derived one from each URL's host. That host was also the key
for the settings.xml server holding the repository's credentials, and
for any maven-resolver per-repository configuration such as a group-id
filter file, so neither could be shared with a Maven build of the same
repositories.

zpm.json repositories may now be an object mapping each repository id
to its URL, in resolution order. The id names the remote repository and
selects its settings.xml server, as in Maven. The array form is still
accepted, with the host as the id, as before.

cloud/docker-image names its repositories github and central, so the
group-id filter file for github covers zpm too and the host-named copy
is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015AUJDQphhDuZTjetPaNsBg

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants