Repository navigation
mvnd: add 1.0.6 (Maven Daemon, embeds Maven 3.9.16) - #904
Conversation
Per-arch upstream tarballs (GraalVM native client + daemon jars + embedded Maven) under /usr/share/mvnd, matched on target arch like packages/jdk. A /usr/bin/mvnd wrapper defaults JAVA_HOME to the packaged jdk (the daemon is a JVM) and pins MVND_HOME. The embedded Maven's bin/mvn stays off PATH; /usr/bin/mvn belongs to `maven`. The embedded Maven version is pinned in build.ncl; build.sh fails closed if the tarball's maven-core jar disagrees, and the tests assert both versions. Standalone tests: --version through a live daemon, and an offline (-o) `validate` of a packaging=pom project, each stopping the daemon afterwards. Refs #899. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 13 minutes for your next included review. View limit details
Comment |
norrietaylor
left a comment
There was a problem hiding this comment.
The prebuilt is justified (no GraalVM native-image package) and called out with binary_from. The client's DT_NEEDED is only libc/libdl/libpthread/librt, so glibc is right. Stripping the Windows jansi DLLs is good, and the fail-closed embedded-Maven check is nice.
- It doesn't pick up #902's
MAVEN_REPO_LOCAL. mvnd'sEnvironmentenum has no environment binding for it, so in a session with both packages,mvnuses the state dir andmvnduses~/.m2/repository, downloading everything twice. Please pass-Dmaven.repo.local="$MAVEN_REPO_LOCAL"in the wrapper (build.sh:32-34) when it is set. MVND_DAEMON_STORAGEis a real mvnd environment variable. Anenv_state_wiringfor it would fix the unwritable-$HOMEproblem the tests currently work around with-Dmvnd.daemonStorage.needsis inconsistent: jbang (#903) declares networkneeds; mvnd and maven don't. Let's pick one convention for the JVM build tools.- Rebase needed: the branch predates #897 (
jdk→ Temurin 25), so CI tested on 21.
On prebuilt vs building from source for the JVM batch, that's a policy call being settled separately.
Generated by Claude Code
…needs
Review fixes:
- The wrapper forwards MAVEN_REPO_LOCAL (maven's wired local repository)
as -Dmaven.repo.local, so mvn and mvnd in one session share it.
- env_state_wiring MVND_DAEMON_STORAGE -> /state/mvnd: the native client
reads it itself, so the daemon registry no longer needs a writable HOME.
- needs { dns, internet } as the consumer-facing network dep, matching
jbang/curl/go/uv: resolving from Maven Central is mvnd's job.
- Tests set the two wired variables instead of -D flags, and check that the
daemon used that storage and the build that repository.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @norrietaylor. All four are addressed in 13f8b06, on top of a merge of main (c3a0a14):
Verified in a fresh 🤖 Generated with Claude Code |
norrietaylor
left a comment
There was a problem hiding this comment.
All points from my last review are addressed:
- The wrapper forwards
MAVEN_REPO_LOCALas-Dmaven.repo.local(build.sh:41-43). Upstream marks itDISCRIMINATING, and the last-Dwins, so a caller's override still works. MVND_DAEMON_STORAGEis wired, and the test checks it.needsmatches maven and jbang.- The branch is past #897.
mvn and mvnd now share one local repo when both are in the session. The amd64 sha256 matches, and so does the Apache sha512.
Before merging, please confirm in the full minimal-check log that mvnd's standalone tests actually ran; the visible tail doesn't show a package: mvnd section. Merge after #902.
Non-blocking:
- Without maven in the session, nothing sets
MAVEN_REPO_LOCAL, so mvnd falls back to~/.m2. That's worth a line in the wrapper comment. - Optional: point
urlatarchive.apache.org/dist/maven/mvnd/, the canonical location maven already uses.
Generated by Claude Code
|
@norrietaylor on the pre-merge check: you were right to ask. CI did not run mvnd's standalone tests. In the full Every other check passed. CI skips the build-dependent checks for a package it hasn't built and cached, so the green check says nothing about the tests. They did run in a remote session on the same commit (13f8b06, fresh That covers both 🤖 Generated with Claude Code |
What
Adds
packages/mvnd, the Apache Maven Daemon 1.0.6 (latest release on apache/maven-mvnd, 2026-05-30; the2.0.0-rc-*tags are pre-releases on the Maven 4 line). It is a Tier 2 item in the Java loadout checklist (#899).mvnd has two parts. The client,
bin/mvnd, is a GraalVM native image. It hands each build to a long-lived daemon JVM that runs an embedded Maven.Source: the per-arch upstream tarballs
maven-mvnd-1.0.6-linux-{amd64,aarch64}.tar.gz, selected withmatch … targetthe same waypackages/jdkdoes. Each sha256 was computed locally, and its sha512 matches the Apache dist.sha512files (downloads.apache.org/maven/mvnd/1.0.6/). The GitHub release publishes no checksums of its own.Layout: the whole distribution goes under
/usr/share/mvnd, minus the.cmdlaunchers and jansi's Windows DLLs. A/usr/bin/mvndwrapper setsJAVA_HOME=${JAVA_HOME:-/usr/lib/jvm}, because the daemon is spawned from$JAVA_HOME, and pinsMVND_HOME.Runtime deps:
jdk, for the daemon.glibc, for the native client. ItsDT_NEEDEDentries on both arches arelibc.so.6,libdl.so.2,libpthread.so.0andlibrt.so.1, plusld-linux-aarch64.so.1on arm64.bash, for the wrapper,bin/mvnd.shand the embedded Maven's scripts.missing runtime_depspasses as is. The glibc ≥2.34 stub libraries (libdl,libpthread,librt) did not need thepatchelf --replace-neededtreatment thatmaven's libjlinenative got forlibutil(e72c987).Licence: Apache-2.0. Provenance:
GithubRepoapache/maven-mvnd.Prebuilt: we have no GraalVM /
native-imagepackage, and the daemon side builds with Maven from Maven Central.binary_fromrecords it.The embedded Maven (please read)
mvnd 1.0.6 bundles Maven 3.9.16 (
mvn/lib/maven-core-3.9.16.jar). Ourmavenpackage is 3.10.0 (#896). So:/usr/share/mvnd/mvn. Itsbin/mvnis deliberately not put on PATH, so/usr/bin/mvnstill belongs tomaven. A session with both packages getsmvn= 3.10.0 andmvnd= 3.9.16.mvndandmvncan resolve or behave differently on the same project. The embedded Maven also does not have the libjlinenativelibutilproblem, because 3.9.x ships nolib/jline-native.maven_version = "3.9.16"is inbuild.ncl.build.shfails if the tarball'smaven-core-<v>.jardisagrees, and the tests assert it. When a future version-bump PR moves mvnd, the embedded Maven change has to be acknowledged explicitly. I checked this guard: settingmaven_versionto 3.9.15 fails the build.2.0.0-rcline embeds Maven 4. The version checker will propose it when it goes GA. That is a deliberate bump, not a routine one.Network
Almost any real
mvndbuild resolves plugins from Maven Central, so mvnd declaresneeds = { dns, internet }for consumers, as jbang (#903) does and maven does with #902. That is the one convention for the JVM build tools; gradle should follow in its own PR.Session state
env_state_wiringsetsMVND_DAEMON_STORAGEto/state/mvnd. The native client reads that variable itself, so the registry and logs no longer need a writable$HOME(default~/.m2/mvnd).MAVEN_REPO_LOCAL(maven: wire the local repository to a session state dir (MAVEN_REPO_LOCAL) #902) as-Dmaven.repo.local, so in a session with both packagesmvnandmvndshare one repository. A caller's own-Dmaven.repo.localcomes later and still wins.Tests
Both are Standalone. Each keeps the daemon storage and the local repository in its own cwd by setting
MVND_DAEMON_STORAGEandMAVEN_REPO_LOCAL, the two variables a session wires, and runsmvnd --stopafterwards so no JVM outlives the test.mvnd_version:mvnd --versiongoes through a live daemon. It asserts(mvnd) 1.0.6from the client andApache Maven 3.9.16from the daemon.offline_validate: a real build through the daemon, offline (-o). It runsvalidateon apackaging=pomproject, which binds no plugins, and assertsBUILD SUCCESS, that the daemon registry landed in$MVND_DAEMON_STORAGE, and that-Xoutput names the forwarded repository. Anything beyond that (compile, test) needs Maven Central, so it cannot run in an offline test.Verified
I built it in a
pkgbuildsession (arm64) withmin package build --rebuild --verbose mvnd, then ranmin check --packages mvnd. All checks pass, includingstandalone tests,missing runtime_depsandenumerate bins.Negative controls, each in a fresh session:
BUILD XSUCCESSmakesstandalone tests...Fail.maven_version = "3.9.15"makes the build fail closed.Re-verified after the review fixes (13f8b06, fresh session): every check passes. Negative control: expecting a different repository path makes
offline_validatefail.amd64 is not locally verified. It is a different tarball and sha256, and CI's build covers it.
Refs #899.
🤖 Generated with Claude Code