apache / apache/maven-dependency-plugin
writeScriptableOutput appends literal 'null' string for null classifier
- Dominant language
- Java
- Stars
- 175
- Forks
- 196
- Avg merge
- 19h 30m
- Merged PRs (30d)
- 5
Description
`AbstractAnalyzeMojo.writeScriptableOutput()` at line 550:
```java
buf.append(scriptableFlag)
.append(":")
.append(pomFile)
.append(":")
.append(artifact.getDependencyConflictId())
.append(":")
.append(artifact.getClassifier()) // appends "null" string
.append(":")
.append(artifact.getBaseVersion())
.append(":")
.append(artifact.getScope())
.append(System.lineSeparator());
```
`artifact.getClassifier()` returns `null` when no classifier is set. `StringBuilder.append(null)` appends the literal string `"null"` instead of an empty string. For dependencies without a classifier, the output contains `...:null:...` instead of `...::...`, which breaks script consumption of the output.
Note that `writeDependencyXML()` (line 515) correctly handles null classifier with an explicit null check before appending.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.