diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java index 76210d222..054639a1c 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java @@ -559,6 +559,17 @@ private void writeDependencyXML(Set artifacts) { writer.startElement("artifactId"); writer.writeText(artifact.getArtifactId()); writer.endElement(); + String key = String.format( + "%s:%s:%s%s", + artifact.getGroupId(), + artifact.getArtifactId(), + artifact.getType(), + (artifact.getClassifier() != null ? ":" + artifact.getClassifier() : "")); + if (!managedDependencies.contains(key)) { + writer.startElement("version"); + writer.writeText(artifact.getBaseVersion()); + writer.endElement(); + } if (!managedDependencies.contains(artifact.getDependencyConflictId())) { writer.startElement("version"); writer.writeText(artifact.getBaseVersion());