elharo opened a new issue, #1647:
URL: https://github.com/apache/maven-dependency-plugin/issues/1647
`PropertiesMojo.execute()` at line 114-118:
```java
for (Artifact artifact : artifacts) {
project.getProperties()
.setProperty(
artifact.getDependencyConflictId(),
artifact.getFile().getAbsolutePath()); // NPE if null
}
```
`project.getArtifacts()` can include artifacts where `getFile()` returns
`null` (e.g., unresolved optional dependencies, artifacts with resolution
failures that don't fully fail the build). Calling `.getAbsolutePath()` on null
throws NPE and fails the build.
The extra artifact resolution at lines 129-136 has a similar issue:
```java
artifact = resolverUtil.resolveArtifact(artifact,
project.getRemoteProjectRepositories());
this.project.getProperties().setProperty(toConflictId(artifact),
artifact.getFile().getAbsolutePath());
```
If resolution succeeds but returns a null file, this also NPEs.
--
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]