apache / apache/maven

[MNG-6690] Child pom doesn't use the plugin version specified in the parent pom plugin management

Open
#8,552 0 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

**[Rik Schaaf](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rikschaaf)** opened **[MNG-6690](https://issues.apache.org/jira/browse/MNG-6690?redirect=false)** and commented

I have a parent pom file with the following inside the build tag:

```


...

org.apache.maven.plugins
maven-surefire-plugin
2.22.2

```

And I have a child pom (a direct child) that has the following in the build tag:

```

...

org.apache.maven.plugins
maven-surefire-plugin

```

My expectation is that the build will use version 2.22.2 of the maven surefire plugin.

Instead it runs using version 2.22.1. Only when I explicitly specify the version in the child pom, the build uses version 2.22.2.

I think this is a bug, or at the very least VERY unintuitive behavior.

---

**Affects:** 3.6.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the parent and child POM snippets, using Maven 3.6.0 and the maven-surefire-plugin. Start by tracing pluginManagement inheritance and plugin-version resolution; done means the child build selects version 2.22.2 without declaring that version in the child POM.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.