elharo opened a new issue, #12603:
URL: https://github.com/apache/maven/issues/12603
# DefaultInheritanceAssembler: NPE from null artifactId
**Found in:** maven-4.0.x branch
**File:**
`impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultInheritanceAssembler.java`
(lines 99-109)
**Severity:** Medium
## Description
`child.getArtifactId()` can return null for POMs that inherit their
artifactId. At line 128, `childName.equals(childDirectory)` would then NPE:
```java
String childName = child.getArtifactId(); // can be null
...
if (child.getProjectDirectory() != null) {
childName = child.getProjectDirectory().getFileName().toString(); //
getFileName() can return null
}
```
Additionally, `child.getProjectDirectory().getFileName()` returns null for
root paths (e.g., `/`), causing NPE at `.toString()`.
--
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]