apache / apache/maven

[MNG-8333] Document Maven4 transitive depMgt handling

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

Description

**[Filipe Roque](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=froque)** opened **[MNG-8333](https://issues.apache.org/jira/browse/MNG-8333?redirect=false)** and commented

 
**pom.xml**

```xml

4.0.0

org.example
guava-duplicate-finder-maven-plugin
1.0-SNAPSHOT



org.apache.curator
curator-test
5.7.1
test



```

Apache Maven 4.0.0-beta-4 (697c543b4e3bbec1b99e9d4d1ee8e0302e748f09) works:

```bash
❯ JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64 /opt/maven/apache-maven-4.0.0-beta-4/bin/mvn -q org.basepom.maven:duplicate-finder-maven-plugin:2.0.1:check -Dduplicate-finder.failBuildInCaseOfDifferentContentConflict
```

 
Apache Maven 4.0.0-beta-5 (6e78fcf6f5e76422c0eb358cd11f0c231ecafbad) fails:

```bash
❯ JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64 /home/froque/Downloads/apache-maven-4.0.0-beta-5-bin/apache-maven-4.0.0-beta-5/bin/mvn org.basepom.maven:duplicate-finder-maven-plugin:2.0.1:check -Dduplicate-finder.failBuildInCaseOfDifferentContentConflict
[WARNING] Unable to find the root directory. Create a .mvn directory in the root directory or add the root="true" attribute on the root project's model to identify it.
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------------------< org.example:guava-duplicate-finder-maven-plugin >------------------------------------
[INFO] Building guava-duplicate-finder-maven-plugin 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------
[INFO]
[INFO] --- duplicate-finder:2.0.1:check (default-cli) @ guava-duplicate-finder-maven-plugin ---
[INFO] Checking compile classpath
[INFO] Checking runtime classpath
[INFO] Checking test classpath
[WARNING] Found duplicate and different classes in [com.google.guava:guava:32.0.0-jre, com.google.guava:listenablefuture:1.0]:
[WARNING] com.google.common.util.concurrent.ListenableFuture
[WARNING] Found duplicate classes/resources in test classpath.
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time: 0.888 s
[INFO] Finished at: 2024-10-20T11:01:27+01:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
[ERROR] Failed to execute goal org.basepom.maven:duplicate-finder-maven-plugin:2.0.1:check (default-cli) on project guava-duplicate-finder-maven-plugin: Found duplicate classes/resources! -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
```

I do not understand how  listenablefuture :1.0 entered the picture.

---

**Affects:** 4.0.0-beta-5

**Attachments:**
- [image-2024-10-30-15-51-00-527.png](https://issues.apache.org/jira/secure/attachment/13072499/image-2024-10-30-15-51-00-527.png) (_361.92 kB_)

Contributor guide

Open the contributing guide

Research direction

Start with the supplied pom.xml and reproduce the difference between Maven 4.0.0-beta-4 and beta-5 using the commands in the issue. Read the MNG-8333 context and determine what Maven 4 transitive dependency-management behavior needs documenting, including how listenablefuture:1.0 appears. Done means the relevant Maven documentation clearly explains the observed behavior and version scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.