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 — VerboseJavaScopeSelector.ScopeComparator is inconsistent for scopes outside the ordered list · Issue #136 · apache/maven-dependency-tree

VerboseJavaScopeSelector.ScopeComparator is inconsistent for scopes outside the ordered list #136

New issue
Copy link
New issue
Copy link
Open
#167
Open
VerboseJavaScopeSelector.ScopeComparator is inconsistent for scopes outside the ordered list#136
#167
Copy link
Labels
bugSomething isn't working

Description

@elharo
elharo
opened on Aug 2, 2026
Issue body actions

Summary

VerboseJavaScopeSelector.ScopeComparator orders scopes by indexOf in the fixed list ["compile", "runtime", "provided", "test"]. Any scope not in that list (e.g. system, or a custom scope) returns indexOf == -1 for both operands, so the comparator returns 0 for such pairs and can select the wrong “max” scope. This violates the Comparator contract and can corrupt the REDUCED_SCOPE value recorded on the winning node.

Affected code

src/main/java/org/apache/maven/shared/dependency/graph/internal/VerboseJavaScopeSelector.java:50-57

Suggested fix

Give unknown scopes a deterministic ordering (e.g. treat as lower/least, or fall back to the full known Java scope list including system), and add a test for scopes outside the four listed ones.

Activity

  1. slachiewicz commented on Oct 5, 2026

    @slachiewicz
    slachiewicz
    on Oct 5, 2026 · Hidden as outdated
    show commentMore actions
  2. slachiewicz
    closed this as not plannedon Oct 5, 2026
  3. slachiewicz
    added a commit that references this issue on Oct 6, 2026

    Ignore scopes outside the Java scopes in the verbose scope selector

    d1b7571
  4. slachiewicz
    reopened this on Oct 26, 2026
  5. slachiewicz
    added
    bugSomething isn't working
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.