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 — Compose path segments from repository ids on the 1.9.x line by slachiewicz · Pull Request #2101 · apache/maven-resolver

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Aug 31, 2026

Copy link
Copy Markdown
Member

The 1.9.x line predates the repository key function layer, so the split local repository prefix (LocalPathPrefixComposerFactorySupport, four sites) and the trusted checksums sources (SummaryFileTrustedChecksumsSource, SparseDirectoryTrustedChecksumsSource) splice the raw repository id into paths. This routes those ids through PathUtils.stringToPathSegment and validates the result, matching the 2.x behaviour after #2089 and #2099. Also ports GAECVNameMapperTest from master; GAECVNameMapper itself needed no change since it inherits the earlier fieldToSegment handling from GAVNameMapper.

Repository ids that are exactly ./.. or contain path separators now compose to a neutralized segment (e.g. -DOTDOT-) instead of being spliced verbatim; well-formed ids are unaffected.

Verified: mvn -pl maven-resolver-impl -am test on JDK 17 → 379 tests, 0 failures.

This change was created with AI assistance.

Sorry, something went wrong.

Uh oh!

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

All reactions
@slachiewicz
Compose path segments from repository ids on the 1.9.x line
f54fc57
Route repository ids through PathUtils.stringToPathSegment before they are
used as path segments in the split local repository prefix and the trusted
checksums sources, and validate the result, matching the 2.x behaviour.
Also port GAECVNameMapperTest.
@slachiewicz slachiewicz added the bug Something isn't working label Aug 31, 2026
@cstamas cstamas added this to the 2.0.23 milestone Aug 31, 2026
gnodet
gnodet approved these changes Aug 31, 2026
View reviewed changes

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

Clean, well-adapted backport of repository-id path-segment sanitization from master (#2089, #2099) to the 1.9.x line. All six injection points where raw repository ids are spliced into filesystem paths are correctly guarded, tests are comprehensive, and the code follows existing conventions.

Key observations:

  • Defense-in-depth pattern (stringToPathSegment then validatePathComponent) is consistent with the 2.x approach.
  • The new GAECVNameMapperTest is a clean port from master following 1.9.x test conventions (JUnit 4, Hamcrest).
  • The three dotDotRepositoryIdIsNeutralized tests each verify that .. is neutralized to -DOTDOT-, including a good negative assertion in the SparseDirectory test.
  • The 1.6.x branch does not require further backport — the affected code paths don't exist there.

📋 PR Metadata

Aspect Current Suggested
Milestone 2.0.23 1.9.28

This PR targets maven-resolver-1.9.x, so the milestone should be 1.9.28 rather than 2.0.23.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

Sorry, something went wrong.

Uh oh!

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

All reactions
gnodet added a commit to gnodet/maven-resolver that referenced this pull request Aug 31, 2026
@gnodet
Review loop: reviewed PRs apache#2100, apache#2101 (2026-08-31T13:36:…
bd6b259
…57Z)
@cstamas
cstamas merged commit 7df893e into apache:maven-resolver-1.9.x Aug 31, 2026
17 checks passed

Uh oh!

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

@github-actions github-actions Bot assigned cstamas Aug 31, 2026
@slachiewicz slachiewicz modified the milestones: 2.0.23, 1.9.28 Sep 1, 2026
@slachiewicz
slachiewicz deleted the repository-id-path-segment-1.9.x branch September 7, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnodet gnodet gnodet approved these changes

Uh oh!

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

Assignees

@cstamas cstamas

Labels

bug Something isn't working

Projects

None yet

Milestone

1.9.28

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@slachiewicz @gnodet @cstamas
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.