apache / apache/maven-compiler-plugin

annotationProcessorPaths "leak" version from parent to child pom

Open
#325 2 comments 0 reactions 0 assignees View on GitHub
3.x bug
Dominant language
Java
Stars
261
Forks
191
Avg merge
1d 5h
Merged PRs (30d)
8

Description

### Affected version

3.14.0

### Bug description

Not quite sure if this should be reported here or in the Maven Jira. But as it seems to be related to #180 reporting here first. Please let me know if I should report there.

When a parent POM or `pluginManagement` defines a set of annotation processors with versions, and the child POM or `plugins` defines another set of processors without versions (relying on `dependencyManagement`), the version is inherited from the processor defined at the corresponding position in the list instead of the dependency management.

The following POM shows the issue:
```xml

4.0.0

com.example
maven-compiler-plugin-issue
1.0.0-SNAPSHOT


17
17
UTF-8




org.mapstruct
mapstruct-processor
1.6.3







org.apache.maven.plugins
maven-compiler-plugin
3.14.0



org.projectlombok
lombok
1.18.38








org.apache.maven.plugins
maven-compiler-plugin



org.mapstruct
mapstruct-processor





```

The resulting effective POM end up like this:
```xml


maven-compiler-plugin
3.14.0


default-compile
compile

compile




org.mapstruct
mapstruct-processor
1.18.38




```

If I omit the `groupId` from `plugins` it also inherits it from parent. It feels like Maven's list and non-list merge behavior gets mixed up and it replaces the list but fills in any missing fields.

I am pretty sure that a `combine.children` or `combine.self` may workaround this, but the current way fells wrong.

Let me know if you need any more infos.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.