Re: [PR] IVY-1653: `makepom`: write overrides to Mav en `dependencyManagement` section [ant-ivy]
eric-milles (via GitHub) <[email protected]> Tue, 16 Jun 2026 18:09:50 -0000
| Newsgroups | gmane.comp.jakarta.ant.devel |
|---|---|
| Message-ID | <PR_kwDOATT2Es6izEsm-06453054-06d7-4dba-ad04-537d32ffb5f2@gitbox.apache.org> |
eric-milles commented on code in PR #114:
URL: https://github.com/apache/ant-ivy/pull/114#discussion_r3422977471
##########
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:
You have to see all the lines of the `project` element to know if there is an existing `dependencyManagement` 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]