From d57b9aeb97e7522e7ccf9db58812ad640e7431d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0est=C3=A1k=20V=C3=ADt?= Date: Wed, 20 Dec 2017 15:06:12 +0100 Subject: [PATCH] Added support for installed plugins in Maven scans. --- app/services/OdcService.scala | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/services/OdcService.scala b/app/services/OdcService.scala index 675f2fb..eddccd4 100644 --- a/app/services/OdcService.scala +++ b/app/services/OdcService.scala @@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets.UTF_8 import java.nio.file._ import java.nio.file.attribute.BasicFileAttributes import java.sql.{Array => _} -import java.util.{Properties, Map => JMap} +import java.util.{Properties, UUID, Map => JMap} import _root_.org.apache.commons.lang3.SystemUtils import _root_.org.owasp.dependencycheck.dependency.{VulnerableSoftware => OdcVulnerableSoftware} @@ -69,6 +69,17 @@ class OdcService @Inject() (odcConfig: OdcConfig, odcDbConnectionConfig: OdcDbCo + + {pluginFiles.map{x => + + com.ysoft + ad-hoc-artifact-{UUID.randomUUID().toString} + 1.0-SNAPSHOT + system + {x.toString} + + }} + @@ -192,6 +203,8 @@ class OdcService @Inject() (odcConfig: OdcConfig, odcDbConnectionConfig: OdcDbCo Seq(odcBin, "--version").!!.trim.reverse.takeWhile(_!=' ').reverse } + private def pluginFiles: Seq[File] = new File(new File(odcConfig.odcPath), "plugins").listFiles().toSeq + private def createHintfulOdcCommand(scandirPrefix: String, path: Path, reportFilename: String): Seq[String] = { val newPropertyFile = s"${scandirPrefix}odc.properties" createModifiedProps(newPropertyFile, Map("hints.file" -> s"${scandirPrefix}hints.xml"))