apache / apache/maven

[MNG-1977] Global dependency exclusions

Open
#4,412 58 comments 2 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Kees de Kooter](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kdekooter)** opened **[MNG-1977](https://issues.apache.org/jira/browse/MNG-1977?redirect=false)** and commented

I depend on some libraries, which in turn depend on something
(which in turn depend on something) that I don't want, because I declare
some other artifact in my pom.xml.

A concrete example: I don't want that the artifact "xerces" is imported in
my project because I declare to depend on "xercesImpl" which ships newer
libraries but with the same namespaces.

I guess I would need an "exclude transitive dependency at all", either
globally or from this and that artifact. I saw the \ tag, but it
forces me to be very verbose and have exact control on what is required by a
dependency.

---

**Attachments:**
- [global_excls_it-test_v2.patch](https://issues.apache.org/jira/secure/attachment/12713222/global_excls_it-test_v2.patch) (_17.58 kB_)
- [global_excls_it-test_v3.patch](https://issues.apache.org/jira/secure/attachment/12713105/global_excls_it-test_v3.patch) (_17.10 kB_)
- [global_excls_maven3_v2.patch](https://issues.apache.org/jira/secure/attachment/12713164/global_excls_maven3_v2.patch) (_6.77 kB_)
- [global_excls_maven3_v3.patch](https://issues.apache.org/jira/secure/attachment/12713161/global_excls_maven3_v3.patch) (_9.03 kB_)

**Issue Links:**
- [MNG-2031](https://issues.apache.org/jira/browse/MNG-2031) Easily disable / exclude transitive dependencies
(_**"is duplicated by"**_)
- [MNG-1607](https://issues.apache.org/jira/browse/MNG-1607) Provide the ability to globally exclude a dependency
(_**"is duplicated by"**_)
- [MNG-3696](https://issues.apache.org/jira/browse/MNG-3696) Add explicit transitive dependencies in dependencyManagement section of pom.xml
(_**"is duplicated by"**_)
- [MNG-4501](https://issues.apache.org/jira/browse/MNG-4501) Support global dependency excludes
(_**"is duplicated by"**_)
- [MNG-3173](https://issues.apache.org/jira/browse/MNG-3173) It should be possible to declare transitive dependency exclusions independent of any of the immediately declared dependencies
(_**"is duplicated by"**_)
- [MNG-5959](https://issues.apache.org/jira/browse/MNG-5959) Can maven provide a features that exclude dependency gloablly
(_**"is duplicated by"**_)
- [MNG-5652](https://issues.apache.org/jira/browse/MNG-5652) "supplies"/"provides"/"proffers" concept proposal

- [MNG-177](https://issues.apache.org/jira/browse/MNG-177) supersedes/obsoletes

- [MNG-5600](https://issues.apache.org/jira/browse/MNG-5600) Dependency management import should support exclusions.

- [MNG-1797](https://issues.apache.org/jira/browse/MNG-1797) Dependency excludes apply to every subsequent dependency, not just the one it is declared under.

- [MNG-3196](https://issues.apache.org/jira/browse/MNG-3196) Allow exclusion of a certain transitive dependency across all direct dependencies.

- [MNG-5227](https://issues.apache.org/jira/browse/MNG-5227) The 'optional' flag of a dependency should be manageable.
(_**"is superceded by"**_)

**Remote Links:**
- [Page
](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=65875544)

162 votes, 134 watchers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.