dependencyManagement before dependencies when missing form template

This commit is contained in:
Eric Milles 2026-06-16 14:12:52 -05:00
parent 1bc11cd09c
commit 866fddeb18
Failed to extract signature
2 changed files with 16 additions and 16 deletions

View File

@ -141,25 +141,25 @@ public final class PomModuleDescriptorWriter {
}
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 (!dependenciesPrinted && !dependencyManagement) {
printDependencies(md, out, options, indent, false);
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;
}
if (!dependenciesPrinted) {
printDependencies(md, out, options, lastIndent, true);
dependenciesPrinted = true;
}
}
}
out.println(line);

View File

@ -143,14 +143,6 @@ public class IvyMakePomTest {
" <artifactId>name</artifactId>",
" <packaging>jar</packaging>",
" <version>1.0.0-SNAPSHOT</version>",
" <dependencies>",
" <dependency>",
" <groupId>org.springframework</groupId>",
" <artifactId>spring-aop</artifactId>",
" <version>6.2.9</version>",
" <scope>compile</scope>",
" </dependency>",
" </dependencies>",
" <dependencyManagement>",
" <dependencies>",
" <dependency>",
@ -160,6 +152,14 @@ public class IvyMakePomTest {
" </dependency>",
" </dependencies>",
" </dependencyManagement>",
" <dependencies>",
" <dependency>",
" <groupId>org.springframework</groupId>",
" <artifactId>spring-aop</artifactId>",
" <version>6.2.9</version>",
" <scope>compile</scope>",
" </dependency>",
" </dependencies>",
"</project>",
""
};