Re: [PR] IVY-1653: `makepom`: write overrides to Mav en `dependencyManagement` section [ant-ivy]
maartenc (via GitHub) <[email protected]> Tue, 16 Jun 2026 18:07:10 -0000
| Newsgroups | gmane.comp.jakarta.ant.devel |
|---|---|
| Message-ID | <PR_kwDOATT2Es6izEsm-3bc5404d-4748-4302-bf62-922d23b9053d@gitbox.apache.org> |
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]