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"))