mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-25 10:32:28 +01:00
Added support for installed plugins in Maven scans.
This commit is contained in:
@@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets.UTF_8
|
|||||||
import java.nio.file._
|
import java.nio.file._
|
||||||
import java.nio.file.attribute.BasicFileAttributes
|
import java.nio.file.attribute.BasicFileAttributes
|
||||||
import java.sql.{Array => _}
|
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.apache.commons.lang3.SystemUtils
|
||||||
import _root_.org.owasp.dependencycheck.dependency.{VulnerableSoftware => OdcVulnerableSoftware}
|
import _root_.org.owasp.dependencycheck.dependency.{VulnerableSoftware => OdcVulnerableSoftware}
|
||||||
@@ -69,6 +69,17 @@ class OdcService @Inject() (odcConfig: OdcConfig, odcDbConnectionConfig: OdcDbCo
|
|||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
{pluginFiles.map{x =>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ysoft</groupId>
|
||||||
|
<artifactId>ad-hoc-artifact-{UUID.randomUUID().toString}</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>{x.toString}</systemPath>
|
||||||
|
</dependency>
|
||||||
|
}}
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
@@ -192,6 +203,8 @@ class OdcService @Inject() (odcConfig: OdcConfig, odcDbConnectionConfig: OdcDbCo
|
|||||||
Seq(odcBin, "--version").!!.trim.reverse.takeWhile(_!=' ').reverse
|
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] = {
|
private def createHintfulOdcCommand(scandirPrefix: String, path: Path, reportFilename: String): Seq[String] = {
|
||||||
val newPropertyFile = s"${scandirPrefix}odc.properties"
|
val newPropertyFile = s"${scandirPrefix}odc.properties"
|
||||||
createModifiedProps(newPropertyFile, Map("hints.file" -> s"${scandirPrefix}hints.xml"))
|
createModifiedProps(newPropertyFile, Map("hints.file" -> s"${scandirPrefix}hints.xml"))
|
||||||
|
|||||||
Reference in New Issue
Block a user