elharo opened a new pull request, #1653: URL: https://github.com/apache/maven-dependency-plugin/pull/1653
## Summary `writeScriptableOutput()` appends the literal string `"null"` for dependencies without a classifier, producing `...:null:...` instead of `...::...`. ## Root cause Line 550 in `AbstractAnalyzeMojo.java`: ```java .append(artifact.getClassifier()) ``` `artifact.getClassifier()` returns `null` when no classifier is set, and `StringBuilder.append(null)` appends the literal string `"null"`. ## Fix ```java .append(artifact.getClassifier() != null ? artifact.getClassifier() : "") ``` Note that `writeDependencyXML()` (line 516) already handles null classifier correctly with an explicit null check. ## Integration test Added `mdep-1650-scriptable-output-null-classifier` IT that: - Declares `maven-project`, uses `maven-model` (transitive) - Configures `scriptableOutput=true` with a known flag value - Asserts that no `TESTFLAG:` line contains `:null:` The test fails at HEAD and passes with the fix. -- 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]
