elharo opened a new issue, #12589:
URL: https://github.com/apache/maven/issues/12589
# DefaultModelBuilder: BOM import dependencies incorrectly skipped due to
operator precedence
**Found in:** maven-4.0.x branch
**File:**
`impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java`
(lines 2010-2011)
**Severity:** High
## Description
Due to operator precedence, BOM-type dependencies in `dependencyManagement`
are always skipped:
```java
if (!("pom".equals(dependency.getType()) &&
"import".equals(dependency.getScope()))
|| "bom".equals(dependency.getType())) {
continue;
}
```
This evaluates as `(!(pom && import)) || bom`, which is equivalent to `(!pom
|| !import || bom)`. The `|| "bom".equals(...)` clause causes BOM-type
dependencies to ALWAYS hit `continue`, meaning they are skipped and never
processed as import management.
The correct condition should be:
```java
if (!("pom".equals(dependency.getType()) &&
"import".equals(dependency.getScope()))
&& !"bom".equals(dependency.getType())) {
continue;
}
```
BOM imports in `dependencyManagement` sections are silently ignored.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]