fix for pom dependencies when using lookupArtifactId
@@ -55,6 +55,7 @@ public class PomDependencyVersionResolver implements CoordinateResolver {
String groupId = null;
String artifactId = null;
String version = null;
+ boolean pom = false;
for (int x = 0; x < childNodes.getLength(); x++) {
Node child = childNodes.item(x);
if (child.getNodeName().equals("version")) {
@@ -72,9 +73,20 @@ public class PomDependencyVersionResolver implements CoordinateResolver {
artifactId = valueOfNode(child).get();
}
}
+ if (child.getNodeName().equals("type")) {
+ if (valueOfNode(child).isPresent()) {
+ pom = "pom".equalsIgnoreCase(valueOfNode(child).get());
+ }
}
+ }
+
if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId)) {
- DependencyCoordinate dependencyCoordinate = Dependency.builder().groupId(groupId).artifactId(artifactId).version(version).buildCoordinate();
+ DependencyCoordinate dependencyCoordinate = Dependency.builder()
+ .groupId(groupId)
+ .artifactId(artifactId)
+ .version(version)
+ .pom(pom)
+ .buildCoordinate();
coordinates.put(dependencyCoordinate.getArtifactId(), dependencyCoordinate);
}
}
