Skip to content

[MNG-8578]add exclusion scope to repo, allow exclude dependencies from build(including parent, dependencies, etc)#2106

Closed
XenoAmess wants to merge 1 commit into
apache:masterfrom
xenoamess-fork:feature-add-exclusion-scope-to-repo
Closed

[MNG-8578]add exclusion scope to repo, allow exclude dependencies from build(including parent, dependencies, etc)#2106
XenoAmess wants to merge 1 commit into
apache:masterfrom
xenoamess-fork:feature-add-exclusion-scope-to-repo

Conversation

@XenoAmess

@XenoAmess XenoAmess commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] SUMMARY,
    where you replace MNG-XXX and SUMMARY with the appropriate JIRA issue.
  • Also format the first line of the commit message like [MNG-XXX] SUMMARY.
    Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

…m build(including parent, dependencies, etc)
@XenoAmess XenoAmess force-pushed the feature-add-exclusion-scope-to-repo branch from 0e34230 to 1e01c86 Compare February 12, 2025 01:30
@XenoAmess XenoAmess changed the title add exclusion scope to repo [MNG-8578]add exclusion scope to repo, allow exclude dependencies from build(including parent, dependencies, etc) Feb 12, 2025
@XenoAmess

Copy link
Copy Markdown
Contributor Author

must use with changes in resolver
apache/maven-resolver#654

@elharo elharo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comments as in maven-resolver

@jira-importer

Copy link
Copy Markdown

Resolve #9869

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Code Review — PR #2106

Verdict: ⚠️ Needs significant rework (blocked)

This PR adds top-level <exclusions> to both ModelBase and Parent in the POM schema, plus wiring in DefaultProjectDependenciesResolver to apply them during dependency collection. It also includes unrelated @Nullable/@Nonnull annotation changes in RepositoryUtils.java.

Critical blocker: The companion maven-resolver PR (apache/maven-resolver#654) was closed as wontfix. The resolver API (CollectRequest.addExclusion()) this PR depends on does not exist and will not be released.

Findings

# Severity File Details
1 🔴 High pom.xml Unreleased dependencyresolverVersion is set to 2.0.7.exclusion, which is not a published artifact. Latest releases are 2.0.x. The companion PR was closed as wontfix, so this version will never be released. The PR cannot build.
2 🔴 High maven.mdo Major POM schema change without design proposal — Adds <exclusions> to ModelBase (inherited by both Model and Profile) and Parent. This means profiles would gain exclusion support, and child POMs could exclude transitive dependencies from the parent's graph — novel semantics that need design discussion on the dev list.
3 🔴 High DefaultProjectDependenciesResolver.java:151-156 Won't compile — Calls collect.addExclusion() on CollectRequest, but this method does not exist in any released (or current master) version of maven-resolver.
4 🟡 Medium maven.mdo Misleading field descriptions — Both exclusion fields say "excluded from this repo's dependency list" but neither is on a repository class. ModelBase is the project/profile base, Parent is the parent POM reference. Descriptions should say "this project's" or "this parent's".
5 🟢 Low RepositoryUtils.java Unrelated changes bundled — ~25 methods get @Nullable/@Nonnull annotations, inflating the diff. Only the toExclusion() visibility change (privatepublic) is relevant to the feature. The annotation work should be a separate PR.

Observations

  1. Stale PR — Open 17 months with no response to reviewer feedback. The requested changes (tests, documentation, design proposal) have not been addressed.
  2. No tests — Zero test coverage for the new exclusion feature.
  3. No design proposal — A POM schema change of this magnitude needs community discussion. The scope also doesn't match: title says "exclusion scope to repo" but implementation adds exclusions to ModelBase and Parent, not repositories.
  4. Recommendation — This PR cannot proceed in its current form. The resolver team rejected the companion change, making the entire approach non-viable. If the feature is still desired, it would need a new design proposal discussed on dev@maven, a new resolver PR accepted first, and a clean implementation with tests.

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

Claude Code on behalf of Guillaume Nodet

gnodet added a commit to gnodet/maven that referenced this pull request Jul 10, 2026
Reviewed 3 PRs: apache#11146 (APPROVE), apache#10952 (COMMENT), apache#2106 (COMMENT).
24 total reviews posted. ~35 PRs remaining.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@elharo elharo closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mvn4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants