Skip to content

feat(maven): resolve partial versions to the newest matching release - #7646

Merged
viceice merged 1 commit into
viceice/feat/android-gem-partial-versionsfrom
viceice/feat/maven-partial-versions
Oct 9, 2026
Merged

viceice merged 1 commit into
viceice/feat/android-gem-partial-versionsfrom
viceice/feat/maven-partial-versions

Conversation

@viceice

@viceice viceice commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Changes

Partial versions for maven, like the other resolvers of this stack:

  • install-tool maven 3 or 3.9 resolves to the newest matching stable release from Maven Central's maven-metadata.xml (read through the CDN and URL replacements); prereleases like 4.0.0-rc-1 are skipped.
  • A version which exists as a release, like 3.0, is installed exactly as given; a partial without a match throws; when the release list can't be loaded or parsed the version is kept.
  • latest and no version still install the newest containerbase maven prebuild.
  • The repo.maven.apache.org fallback download uses the version as given, so two-part releases like 3.0 install, and validate accepts them.
  • install-tool --help and docs/tools.md document it, and the java container test installs maven 3.

Context

Please select one of the following:

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Implemented by Claude Sonnet 5.5 and reviewed by Claude Opus 5.5 in Claude Code.

Use of AI in replying to PR comments

Who answers review comments:

  • @viceice will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted. Name the account.
  • An agent will draft replies and reply autonomously. This is heavily discouraged, and we prefer that there are humans in the loop
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

🤖 Generated with Claude Code

@viceice
viceice added this pull request to stack #7631 October 8, 2026 08:40
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: containerbase/coderabbit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5173eca3-5889-405f-96d9-1d490979a930

📥 Commits

Reviewing files that changed from the base of the PR and between 6e371d9 and e94c1c8.


📒 Files selected for processing (6)
  • docs/tools.md
  • src/cli/install-tool/version-resolvers.spec.ts
  • src/cli/tools/java/maven.spec.ts
  • src/cli/tools/java/maven.ts
  • src/cli/tools/java/schema.ts
  • test/java/Dockerfile


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@viceice
viceice force-pushed the viceice/feat/maven-partial-versions branch from 58e3f9b to 4c1a4ad Compare October 8, 2026 08:49
@viceice
viceice force-pushed the viceice/feat/maven-partial-versions branch 2 times, most recently from 9051842 to 1e1ba55 Compare October 8, 2026 12:43
Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
@viceice
viceice force-pushed the viceice/feat/maven-partial-versions branch from 1e1ba55 to e94c1c8 Compare October 9, 2026 09:52
@viceice
viceice marked this pull request as ready for review October 9, 2026 09:53
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Resolve partial Maven versions to the newest matching stable release

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Resolve partial Maven versions against Maven Central while preserving exact releases and existing
 latest behavior.
• Accept two-part Maven releases in validation and fallback downloads.
• Document the behavior and test resolution, failures, URL replacement, and installation.
Diagram

graph TD
  A["Version request"] --> B{"Latest or missing?"} -->|partial| D["Central metadata"] --> E["Stable match"] --> F["Maven installer"] -->|no prebuild| G["Central archive"]
  B -->|yes| C["Prebuild latest"] --> F
  B -->|pinned| F
  D -->|lookup fails| F
Loading
High-Level Assessment

The approach fits the existing resolver and installer boundaries: it reuses shared partial-version matching, the project's XML parsing dependencies, and the HTTP service for URL replacement. Using prebuild releases as the partial-version catalog would not cover Maven Central releases without prebuilds.

Files changed (6) +251 / -6

Enhancement (2) +90 / -5
maven.tsResolve partial Maven releases from Maven Central +72/-5

Resolve partial Maven releases from Maven Central

• Reads Maven metadata to select the newest matching stable release while preserving exact releases and retaining the supplied version if metadata cannot be read. Keeps the prebuild lookup for 'latest', accepts two-part releases, and uses their supplied version in Maven Central fallback URLs.

src/cli/tools/java/maven.ts

schema.tsParse Maven metadata release lists +18/-0

Parse Maven metadata release lists

• Adds a schema that extracts and trims Maven release versions, accepting both single-version and array-shaped XML parser output.

src/cli/tools/java/schema.ts

Tests (3) +156 / -1
version-resolvers.spec.tsExpect Maven in partial-version CLI help +1/-1

Expect Maven in partial-version CLI help

• Updates the help-text expectation to include Maven among tools that accept major and major.minor versions.

src/cli/install-tool/version-resolvers.spec.ts

maven.spec.tsTest Maven resolution and two-part installation +148/-0

Test Maven resolution and two-part installation

• Covers stable matching, existing releases, single-entry metadata, lookup and parsing failures, URL replacement, and unmatched versions. Also tests validation and Maven Central fallback installation for '3.0'.

src/cli/tools/java/maven.spec.ts

DockerfileExercise partial Maven installation in a container +7/-0

Exercise partial Maven installation in a container

• Installs 'maven 3' in the partial-version test stage and checks that the resulting Maven executable reports a version in the 3.x series.

test/java/Dockerfile

Documentation (1) +5 / -0
tools.mdDocument Maven partial-version behavior +5/-0

Document Maven partial-version behavior

• Explains stable matching, exact two-part releases, metadata lookup failures, and the unchanged containerbase prebuild behavior for 'latest' or no version.

docs/tools.md

@qodo-code-review

qodo-code-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Resolved findings
1. Arm64 never tests partial Maven installs ✗ Dismissed
Description
test/java/Dockerfile adds install-tool maven 3, but the matching arm64 Dockerfile only installs
a pinned full version. The new partial-version lookup is therefore exercised in the amd64 smoke test
but not in the arm64 test image.
Code

test/java/Dockerfile[262]

+RUN install-tool maven 3
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new Maven partial-version smoke test runs only in the amd64 Java test image.

## Fix Focus Areas
- test/java/Dockerfile[262-265]
- test/java/Dockerfile.arm64[51-60]

## Recommended Fix
Add an `install-tool maven 3` smoke test to the arm64 Java Dockerfile and verify the installed Maven runs.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread test/java/Dockerfile
@viceice
viceice added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit abc915f Oct 9, 2026
61 of 70 checks passed
@viceice
viceice deleted the viceice/feat/maven-partial-versions branch October 9, 2026 12:05
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.

1 participant