Added support for scanning of non-JAR packages from Maven

This commit is contained in:
Šesták Vít
2018-10-22 12:49:17 +02:00
parent ef5d7e911d
commit 8b8c072510
2 changed files with 21 additions and 11 deletions

View File

@@ -54,7 +54,8 @@ class LibraryAdvisor @Inject() (
val groupId = (xml \ "groupId").text
val artifactId = (xml \ "artifactId").text
val version = (xml \ "version").text
Left(odcService.scanMaven(groupId, artifactId, version))
val depType = (xml \ "type").text
Left(odcService.scanMaven(groupId, artifactId, version, depType))
case other =>
Right(s"Unknown root XML element: $other")
}
@@ -68,7 +69,7 @@ class LibraryAdvisor @Inject() (
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic/0.9.10
url.getPath.split('/') match {
case Array("", "artifact", groupId, artifactId, version) =>
Left(odcService.scanMaven(groupId, artifactId, version))
Left(odcService.scanMaven(groupId, artifactId, version, ""))
case _ =>
Right("Unknown path for mvnrepository.com: Expected https://mvnrepository.com/artifact/<groupId>/<artifactId>/<version>")
}