siblings
This commit is contained in:
@@ -131,7 +131,7 @@ public class SiblingDependencyResolver {
|
||||
if (artifactId != null && targetArtifacts.contains(artifactId)) {
|
||||
Path siblingDir = p.getParent();
|
||||
if (!siblingDir.equals(projectDir)) {
|
||||
log.info("Discovered local Maven sibling dependency: {}", siblingDir);
|
||||
log.info("Discovered local Maven sibling dependency via artifact match: {}", siblingDir);
|
||||
siblings.add(siblingDir);
|
||||
}
|
||||
}
|
||||
@@ -142,6 +142,24 @@ public class SiblingDependencyResolver {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Also directly add aggregator <module> directories declared in this pom
|
||||
Matcher moduleMatcher = Pattern.compile("<module>(.*?)</module>").matcher(content);
|
||||
while (moduleMatcher.find()) {
|
||||
String moduleName = moduleMatcher.group(1).trim();
|
||||
Path moduleDir = projectDir.resolve(moduleName).normalize();
|
||||
if (Files.exists(moduleDir) && Files.exists(moduleDir.resolve("pom.xml")) && !moduleDir.equals(projectDir)) {
|
||||
log.info("Discovered local Maven sibling dependency via <module>: {}", moduleDir);
|
||||
siblings.add(moduleDir);
|
||||
}
|
||||
}
|
||||
|
||||
// Also add parent dir if it has a pom.xml
|
||||
Path parentDir = projectDir.getParent();
|
||||
if (parentDir != null && Files.exists(parentDir.resolve("pom.xml")) && !parentDir.equals(projectDir)) {
|
||||
log.info("Discovered local Maven parent sibling: {}", parentDir);
|
||||
siblings.add(parentDir);
|
||||
}
|
||||
}
|
||||
return siblings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user