maartenc commented on code in PR #114:
URL: https://github.com/apache/ant-ivy/pull/114#discussion_r3422962226


##########
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 know the order doesn't matter.
   But could you print the overrides first? It's personal, but I like it a bit 
more if in a pom the `<dependencymanagement> `comes before the `<dependencies>` 
element.



-- 
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]

Reply via email to