GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [maven-resolver-1.9.x] Fix #1269: Report a clear message when resolving an artifact with no version by arturobernalg · Pull Request #2221 · apache/maven-resolver

Conversation

@arturobernalg

@arturobernalg arturobernalg commented Oct 22, 2026

Copy link
Copy Markdown
Member

Backport of #2209 (e9cd7f3 on master) to maven-resolver-1.9.x.

DefaultArtifactResolver accepts a VersionResult whose version is null or blank, which happens whenever the request's Artifact has no version at all (#1269 / MRESOLVER-597). It keeps going, and the failure only surfaces much later as an opaque IllegalArgumentException from the local repository path composer, with no mention of the real cause.

DefaultArtifactResolver#resolve now rejects a null or blank resolved version right after it is applied to the artifact, with an ArtifactNotFoundException that names the artifact and says its version is missing or blank.

The production fix is identical to master's. The test is ported to this module's JUnit 4 style (master has since moved to JUnit 5) since DefaultArtifactResolverTest here still uses org.junit.Test/org.junit.Assert.

Both new tests fail without the production change and pass with it. Full maven-resolver-impl module (589 tests), checkstyle:check and spotless:check are green.

  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
  • I hereby declare that I have filed an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@arturobernalg
[Backport maven-resolver-1.9.x] Fix apache#1269: Report a clear messa…
de5a2ab
…ge when resolving an artifact with no version (apache#2209)

DefaultArtifactResolver accepts a VersionResult whose version is null or
blank, which happens whenever the request's Artifact has no version at
all. It keeps going, and the failure only surfaces much later as an
opaque IllegalArgumentException from the local path composer, with no
mention of the real cause.

DefaultArtifactResolver#resolve now rejects a null or blank resolved
version immediately after it is applied to the artifact, with an
ArtifactNotFoundException that names the artifact and says its version
is missing or blank.

Same fix as master (e9cd7f3), ported to this module's JUnit 4 test
style; the production code is unchanged.
gnodet-bot
gnodet-bot approved these changes Oct 22, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Clean, correct backport of the master fix (#2209) to maven-resolver-1.9.x. The version guard is null-safe (emptify() in DefaultArtifact ensures getVersion() is never null), the continue correctly skips only the failing request in multi-artifact batch resolution (consistent with the existing VersionResolutionException pattern), and the 1-arg addException is the right adaptation for the 1.9.x API (no ArtifactResult.NO_REPOSITORY on this branch). Both edge cases — empty string and whitespace-only version — are covered by the two JUnit 4 tests, which are faithful ports of the master equivalents.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cstamas

cstamas commented Oct 22, 2026

Copy link
Copy Markdown
Member

@arturobernalg unsure is it worth to spend energy on Resolver 1.x (and even Maven 3.9.x); we are fleeing forward with Maven 3.10.1 (and Resolver 2.0.x).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slachiewicz slachiewicz added the enhancement New feature or request label Oct 29, 2026
@slachiewicz slachiewicz mentioned this pull request Nov 20, 2026
[1.9.x] Migrate the tests to JUnit 5 #2338
Merged
@slachiewicz slachiewicz added bug Something isn't working resolver1 and removed enhancement New feature or request labels Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@gnodet-bot gnodet-bot gnodet-bot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working resolver1

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@arturobernalg @cstamas @gnodet-bot @slachiewicz
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.