Re: [PR] IVY-1653: `makepom`: write overrides to Mav en `dependencyManagement` section [ant-ivy]

maartenc (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.ant.devel
Message-ID <PR_kwDOATT2Es6izEsm-64d0011e-d93a-4462-8aca-ea495c26cb2b@gitbox.apache.org>
maartenc commented on code in PR #114:
URL: https://github.com/apache/ant-ivy/pull/114#discussion_r2283059221


##########
src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java:
##########
@@ -343,8 +359,51 @@ private static void printExclusions(ExcludeRule[] exclusions, PrintWriter out, i
         out.println("</exclusions>");
     }
 
-    private static DependencyDescriptor[] getDependencies(ModuleDescriptor md,
-            PomWriterOptions options) {
+    private static void printOverrides(ModuleDescriptor md, PrintWriter out, int indent, boolean container) {
+        ModuleRules<DependencyDescriptorMediator> mr = md.getAllDependencyDescriptorMediators();
+        if (mr.getAllRules().isEmpty()) {
+            return;
+        }

Review Comment:
   Perhaps also return here if none of the rules are an instance of non-wildcard OverrideDependencyDescriptorMediator.
   This way, we avoid an empty `<dependencyManagement>/<dependencies>`-construct if container was true.



-- 
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.