apache / apache/maven

[MNG-8078] BOM POM import warnings are emitted on scopes and exclusions

Open
#10,850 0 comments 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Lenny Primak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=lprimak)** opened **[MNG-8078](https://issues.apache.org/jira/browse/MNG-8078?redirect=false)** and commented

There a couple of scenarios that are generating warnings that should not:
* BOM dependency entries that have a different scope
* BOM dependency entries that have exclusions

There are many scenarios where multiple BOMs declare the same dependency versions, although in slightly different ways. Many of these are transient, and very hard to figure out in the first place. Warnings lead to multiple unnecessary exclusions and are forcing modifications to POM where they are not needed.

The above entries should not generate a warning, because the dependencies are not conflicting.

Examples (BOM):

```java


...

org.junit.jupiter
junit-jupiter-api
${junit.version}
test

org.junit.jupiter
junit-jupiter-params
${junit.version}
test

org.junit.jupiter
junit-jupiter-engine
${junit.version}
test

...

```

 

Warnings:

```java
[WARNING] Some problems were encountered while building the effective model for 'com.flowlogix:hope-website:war:1.x-SNAPSHOT'
[WARNING] Ignored POM import for: org.slf4j:jcl-over-slf4j:jar:2.0.12@test as already imported org.slf4j:jcl-over-slf4j:jar:2.0.12@compile.  Add a the conflicting managed dependency directly to the dependencyManagement section of the POM.

WARNING] Ignored POM import for: net.bytebuddy:byte-buddy:jar:1.14.12@compile[1 exclusions] as already imported net.bytebuddy:byte-buddy:jar:1.14.12@compile.  Add a the conflicting managed dependency directly to the dependencyManagement section of the POM.
[WARNING] Ignored POM import for: net.bytebuddy:byte-buddy-agent:jar:1.14.12@compile[1 exclusions] as already imported net.bytebuddy:byte-buddy-agent:jar:1.14.12@compile.  Add a the conflicting managed dependency directly to the dependencyManagement section of the POM.
[WARNING] Ignored POM import for: org.junit.jupiter:junit-jupiter-api:jar:5.10.2@compile[1 exclusions] as already imported org.junit.jupiter:junit-jupiter-api:jar:5.10.2@test.  Add a the conflicting managed dependency directly to the dependencyManagement section of the POM.
[WARNING] Ignored POM import for: org.junit.jupiter:junit-jupiter-engine:jar:5.10.2@compile[1 exclusions] as already imported org.junit.jupiter:junit-jupiter-engine:jar:5.10.2@test.  Add a the conflicting managed dependency directly to the dependencyManagement section of the POM.
[WARNING] Ignored POM import for: org.junit.jupiter:junit-jupiter-params:jar:5.10.2@compile[1 exclusions] as already imported org.junit.jupiter:junit-jupiter-params:jar:5.10.2@test.  Add a the conflicting managed dependency directly to the dependencyManagement section of the POM.
```

---

**Affects:** 4.0.0-alpha-13

**Issue Links:**
- [MNG-7854](https://issues.apache.org/jira/browse/MNG-7854) Non directly managed imported and conflicting depMgt entries should warn
(_**"is caused by"**_)

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by locating Maven's BOM POM-import warning generation and reproduce the scope and exclusion examples; done means those entries no longer warn while genuinely conflicting managed dependencies still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.