maartenc commented on code in PR #114:
URL: https://github.com/apache/ant-ivy/pull/114#discussion_r3423037645
##########
src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java:
##########
@@ -135,14 +140,26 @@ public static void write(ModuleDescriptor md, File
output, PomWriterOptions opti
dependencyManagement = false;
}
- if (line.contains("</dependencies>") &&
!dependenciesPrinted && !dependencyManagement) {
- printDependencies(md, out, options, indent, false);
- dependenciesPrinted = true;
+ if (line.contains("</dependencies>")) {
+ if (!dependenciesPrinted && !dependencyManagement) {
+ printDependencies(md, out, options, indent, false);
+ dependenciesPrinted = true;
+ }
+ if (!overridesPrinted && dependencyManagement) {
+ printOverrides(md, out, indent, false);
+ overridesPrinted = true;
+ }
}
- if (line.contains("</project>") && !dependenciesPrinted) {
- printDependencies(md, out, options, lastIndent, true);
- dependenciesPrinted = true;
+ if (line.contains("</project>")) {
+ if (!dependenciesPrinted) {
+ printDependencies(md, out, options, lastIndent,
true);
+ dependenciesPrinted = true;
+ }
+ if (!overridesPrinted) {
+ printOverrides(md, out, lastIndent, true);
+ overridesPrinted = true;
+ }
Review Comment:
I'm just thinking in the case here where there a no `<dependencyManagment>`
or `<dependencies>` elements yet.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]