Skip to content

feat: jpm outdated and jpm update for pinned versions - #26

Merged
CoderSerio merged 5 commits into
mainfrom
feat/jpm-update
Dec 6, 2026
Merged

CoderSerio merged 5 commits into
mainfrom
feat/jpm-update

Conversation

@CoderSerio

@CoderSerio CoderSerio commented Dec 6, 2026 •

Copy link
Copy Markdown
Owner

What changes

Two commands for the versions package.json pins, modeled on npm and pnpm:

jpm outdated            # Current / Wanted / Latest / Location, exits 1 when something is behind
jpm update              # every pinned version, to the newest release with the same major version
jpm update com.google.guava:guava --latest   # one coordinate, across major versions
  • What counts as pinned: java.springBoot (as org.springframework.boot:spring-boot-starter-parent), dependency versions in java.dependencies and in modules, and java.versions. Versions Spring Boot manages follow Spring Boot; jpm update <managed coordinate> says to update Spring Boot instead.
  • Wanted vs latest: Maven has no ^/~ ranges, so jpm update stays within the current major version by default, like pnpm update, and --latest crosses it, like pnpm update --latest. It never downgrades.
  • Stable releases only, from the same maven-metadata.xml lookup jpm add already uses (JPM_MAVEN_REPOSITORY). RCs and milestones are skipped, and a flavor such as Guava's -jre is kept, since its metadata also lists -android releases, which can be the release marker.
  • After updating, it saves package.json, regenerates the POMs and resolves dependencies like jpm install.
  • Hand-maintained POMs (java.pom: "manual") are refused with a pointer to ./mvnw versions:display-dependency-updates.
  • A lookup that fails, such as a private artifact, is reported per coordinate. outdated and a bare update continue; an explicit jpm update <coordinate> fails.
  • Under the hood, latestRelease is split into stableReleases plus a small compareVersions, and the new src/outdated.ts collects the pins and computes wanted/latest.

Docs: both command references (with the same "not released yet" note as #25), the JPM_MAVEN_REPOSITORY row in both configuration docs, both READMEs, and the CHANGELOG.

Checks run

  • npm run check: 109 tests, 104 pass, 5 skipped (Windows only), 0 fail. The new CLI test uses a fake fetch: wanted/latest per major, the Guava flavor, Spring Boot, a 404, the error cases, multi-module locations and the manual refusal.
  • cd site && npm run build && npm run check:links: pass; the command index picks up both commands.
  • Manually, against Maven Central on macOS, in a managed two-module Boot project with Spring Boot 4.1.0, Guava 32.0.0-jre and commons-lang3 3.12.0:
    • outdated listed all three and exited 1.
    • update moved them to 4.2.0, 32.1.3-jre and 3.22.0 and noted the newer Guava major.
    • doctor then reported the POMs matching, and jpm build -- -DskipTests passed.

Not covered: Windows, and repositories that need authentication (the lookup uses only JPM_MAVEN_REPOSITORY, not Maven's settings).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added jpm outdated to identify pinned Java dependencies with newer stable releases, with workspace filtering and JSON output.
    • Added jpm update (also available as up and upgrade) to update dependencies to the newest release in the same major version by default, or the latest release with --latest. Updates sync the project manifest and resolve dependencies.
  • Documentation
    • Added command guidance in English and Chinese, including version selection, repository lookup, and failure behavior.

- jpm outdated lists Spring Boot, dependency versions and java.versions that
  have newer stable releases, with npm's current/wanted/latest columns, and
  exits with 1 when something is behind.
- jpm update moves them to the newest release with the same major version,
  or with --latest to the latest, like pnpm update, then syncs the POM and
  resolves dependencies. A flavor such as Guava's -jre is kept.
- Versions Spring Boot manages follow Spring Boot. Hand-maintained POM
  projects get a pointer to versions:display-dependency-updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Dec 6, 2026
@coderabbitai

coderabbitai Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The CLI adds outdated and update commands. They discover stable releases for pinned Java and Spring Boot versions, report available versions, and update selected manifest pins. Updates sync the POM and resolve dependencies. English and Chinese command and configuration documentation describe the new commands.

Changes: Version discovery and update commands

Layer / File(s) Summary
Stable release and pin discovery
src/repository.ts, src/outdated.ts
The repository code exposes stable release lists and version comparison helpers. Pin discovery collects Spring Boot, shared, root, and module versions. Update discovery deduplicates repository lookups and reports the newest matching-flavor release and newest same-major release.
Command registration and outdated reporting
src/cli.ts, test/cli.test.js, docs/cli.md, docs/cli.zh-CN.md, docs/configuration.md, docs/configuration.zh-CN.md, README.md, README.zh-CN.md, CHANGELOG.md
The CLI registers outdated and update, supports up and upgrade aliases, and rejects manual-POM projects. outdated reports update candidates and lookup failures in text or JSON, with status codes based on the results. Help, command references, configuration notes, and the changelog describe the commands.
Update selection and dependency resolution
src/cli.ts, test/cli.test.js, docs/cli.md, docs/cli.zh-CN.md
update accepts selected dependencies and workspaces, uses same-major versions by default, and accepts --latest for cross-major updates. It saves changed manifest versions, invokes Maven dependency resolution, and reports lookup or resolution failures. Integration tests cover version selection, errors, workspace behavior, and persisted changes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CLI as jpm CLI
  participant Pins as pinnedVersions
  participant Updates as findUpdates
  participant Repository as stableReleases
  participant Manifest as package.json
  participant Maven
  CLI->>Pins: collect project and module pins
  CLI->>Updates: find candidate versions
  Updates->>Repository: look up stable releases by coordinate
  Repository-->>Updates: stable versions and release marker
  Updates-->>CLI: wanted versions, latest versions, lookup errors
  CLI->>Manifest: save selected version changes
  CLI->>Maven: resolve dependencies
Loading

Possibly related PRs

  • 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

A rabbit checks the versions in a row
Finds stable releases, sorts them just so
Same-major hops are chosen by default
--latest lets the rabbit range about
Then POMs sync, and Maven gets to go

@CoderSerio
CoderSerio merged commit ae01a94 into main Dec 6, 2026
26 of 27 checks passed
@CoderSerio
CoderSerio deleted the feat/jpm-update branch December 6, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant