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:
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().
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:Additionally,
child.getProjectDirectory().getFileName()returns null for root paths (e.g.,/), causing NPE at.toString().