Class Check

  • All Implemented Interfaces:
    java.lang.Cloneable

    @NotThreadSafe
    public class Check
    extends Update
    An Ant task definition to execute dependency-check during an Ant build.
    Author:
    Jeremy Long
    • Constructor Detail

      • Check

        public Check()
        Construct a new DependencyCheckTask.
    • Method Detail

      • add

        public void add​(org.apache.tools.ant.types.ResourceCollection rc)
        Add an arbitrary ResourceCollection.
        Parameters:
        rc - the ResourceCollection to add.
        Since:
        Ant 1.7
      • isReference

        public boolean isReference()
        Learn whether the refId attribute of this element been set.
        Returns:
        true if refId is valid.
      • setRefId

        public void setRefId​(org.apache.tools.ant.types.Reference r)
        Add a reference to a Path, FileSet, DirSet, or FileList defined elsewhere.
        Parameters:
        r - the reference to a path, fileset, dirset or filelist.
      • addConfiguredSuppressionFile

        public void addConfiguredSuppressionFile​(SuppressionFile suppressionFile)
        Add a suppression file.

        This is called by Ant with the configured SuppressionFile.

        Parameters:
        suppressionFile - the suppression file to add.
      • addConfiguredReportFormat

        public void addConfiguredReportFormat​(Check.ReportFormat reportFormat)
        Add a report format.

        This is called by Ant with the configured Check.ReportFormat.

        Parameters:
        reportFormat - the reportFormat to add.
      • setVersionCheckEnabled

        public void setVersionCheckEnabled​(java.lang.Boolean versionCheckEnabled)
        Sets whether the version check is enabled.
        Parameters:
        versionCheckEnabled - a Boolean indicating if the version check is enabled.
      • getProjectName

        public java.lang.String getProjectName()
        Get the value of projectName.
        Returns:
        the value of projectName
      • setProjectName

        public void setProjectName​(java.lang.String projectName)
        Set the value of projectName.
        Parameters:
        projectName - new value of projectName
      • setReportOutputDirectory

        public void setReportOutputDirectory​(java.lang.String reportOutputDirectory)
        Set the value of reportOutputDirectory.
        Parameters:
        reportOutputDirectory - new value of reportOutputDirectory
      • setFailBuildOnCVSS

        public void setFailBuildOnCVSS​(float failBuildOnCVSS)
        Set the value of failBuildOnCVSS.
        Parameters:
        failBuildOnCVSS - new value of failBuildOnCVSS
      • setJunitFailOnCVSS

        public void setJunitFailOnCVSS​(float junitFailOnCVSS)
        Set the value of junitFailOnCVSS.
        Parameters:
        junitFailOnCVSS - new value of junitFailOnCVSS
      • setAutoUpdate

        public void setAutoUpdate​(java.lang.Boolean autoUpdate)
        Set the value of autoUpdate.
        Parameters:
        autoUpdate - new value of autoUpdate
      • setPrettyPrint

        public void setPrettyPrint​(boolean prettyPrint)
        Set the value of prettyPrint.
        Parameters:
        prettyPrint - new value of prettyPrint
      • setReportFormat

        public void setReportFormat​(Check.ReportFormats reportFormat)
        Set the value of reportFormat.
        Parameters:
        reportFormat - new value of reportFormat
      • getReportFormats

        public java.util.List<java.lang.String> getReportFormats()
        Get the value of reportFormats.
        Returns:
        the value of reportFormats
      • setSuppressionFile

        public void setSuppressionFile​(java.lang.String suppressionFile)
        Set the value of suppressionFile.
        Parameters:
        suppressionFile - new value of suppressionFile
      • setSuppressionFileUser

        public void setSuppressionFileUser​(java.lang.String suppressionFileUser)
        Sets the username to download user-authored suppression files from an HTTP Basic auth protected location.
        Parameters:
        suppressionFileUser - The username
      • setSuppressionFilePassword

        public void setSuppressionFilePassword​(java.lang.String suppressionFilePassword)
        Sets the password/token to download user-authored suppression files from an HTTP Basic auth protected location.
        Parameters:
        suppressionFilePassword - The password/token
      • setSuppressionFileBearerToken

        public void setSuppressionFileBearerToken​(java.lang.String suppressionFileBearerToken)
        Sets the token to download user-authored suppression files from an HTTP Bearer auth protected location.
        Parameters:
        suppressionFileBearerToken - The token
      • setHintsFile

        public void setHintsFile​(java.lang.String hintsFile)
        Set the value of hintsFile.
        Parameters:
        hintsFile - new value of hintsFile
      • setShowSummary

        public void setShowSummary​(boolean showSummary)
        Set the value of showSummary.
        Parameters:
        showSummary - new value of showSummary
      • setEnableExperimental

        public void setEnableExperimental​(java.lang.Boolean enableExperimental)
        Set the value of enableExperimental.
        Parameters:
        enableExperimental - new value of enableExperimental
      • setEnableRetired

        public void setEnableRetired​(java.lang.Boolean enableRetired)
        Set the value of enableRetired.
        Parameters:
        enableRetired - new value of enableRetired
      • setJarAnalyzerEnabled

        public void setJarAnalyzerEnabled​(java.lang.Boolean jarAnalyzerEnabled)
        Sets whether or not the analyzer is enabled.
        Parameters:
        jarAnalyzerEnabled - the value of the new setting
      • setArchiveAnalyzerEnabled

        public void setArchiveAnalyzerEnabled​(java.lang.Boolean archiveAnalyzerEnabled)
        Sets whether the analyzer is enabled.
        Parameters:
        archiveAnalyzerEnabled - the value of the new setting
      • setAssemblyAnalyzerEnabled

        public void setAssemblyAnalyzerEnabled​(java.lang.Boolean assemblyAnalyzerEnabled)
        Sets whether or not the analyzer is enabled.
        Parameters:
        assemblyAnalyzerEnabled - the value of the new setting
      • setMSBuildAnalyzerEnabled

        public void setMSBuildAnalyzerEnabled​(java.lang.Boolean msbuildAnalyzerEnabled)
        Sets whether or not the analyzer is enabled.
        Parameters:
        msbuildAnalyzerEnabled - the value of the new setting
      • setNuspecAnalyzerEnabled

        public void setNuspecAnalyzerEnabled​(java.lang.Boolean nuspecAnalyzerEnabled)
        Sets whether or not the analyzer is enabled.
        Parameters:
        nuspecAnalyzerEnabled - the value of the new setting
      • setNugetconfAnalyzerEnabled

        public void setNugetconfAnalyzerEnabled​(java.lang.Boolean nugetconfAnalyzerEnabled)
        Sets whether or not the analyzer is enabled.
        Parameters:
        nugetconfAnalyzerEnabled - the value of the new setting
      • setLibmanAnalyzerEnabled

        public void setLibmanAnalyzerEnabled​(java.lang.Boolean libmanAnalyzerEnabled)
        Sets whether or not the analyzer is enabled.
        Parameters:
        libmanAnalyzerEnabled - the value of the new setting
      • setComposerAnalyzerEnabled

        public void setComposerAnalyzerEnabled​(java.lang.Boolean composerAnalyzerEnabled)
        Set the value of composerAnalyzerEnabled.
        Parameters:
        composerAnalyzerEnabled - new value of composerAnalyzerEnabled
      • setComposerAnalyzerSkipDev

        public void setComposerAnalyzerSkipDev​(java.lang.Boolean composerAnalyzerSkipDev)
        Set the value of composerAnalyzerSkipDev.
        Parameters:
        composerAnalyzerSkipDev - new value of composerAnalyzerSkipDev
      • setCpanfileAnalyzerEnabled

        public void setCpanfileAnalyzerEnabled​(java.lang.Boolean cpanfileAnalyzerEnabled)
        Set the value of cpanfileAnalyzerEnabled.
        Parameters:
        cpanfileAnalyzerEnabled - new value of cpanfileAnalyzerEnabled
      • setAutoconfAnalyzerEnabled

        public void setAutoconfAnalyzerEnabled​(java.lang.Boolean autoconfAnalyzerEnabled)
        Set the value of autoconfAnalyzerEnabled.
        Parameters:
        autoconfAnalyzerEnabled - new value of autoconfAnalyzerEnabled
      • setPipAnalyzerEnabled

        public void setPipAnalyzerEnabled​(java.lang.Boolean pipAnalyzerEnabled)
        Set the value of pipAnalyzerEnabled.
        Parameters:
        pipAnalyzerEnabled - new value of pipAnalyzerEnabled
      • setPipfileAnalyzerEnabled

        public void setPipfileAnalyzerEnabled​(java.lang.Boolean pipfileAnalyzerEnabled)
        Set the value of pipfileAnalyzerEnabled.
        Parameters:
        pipfileAnalyzerEnabled - new value of pipfileAnalyzerEnabled
      • setPoetryAnalyzerEnabled

        public void setPoetryAnalyzerEnabled​(java.lang.Boolean poetryAnalyzerEnabled)
        Set the value of poetryAnalyzerEnabled.
        Parameters:
        poetryAnalyzerEnabled - new value of poetryAnalyzerEnabled
      • setBundleAuditAnalyzerEnabled

        public void setBundleAuditAnalyzerEnabled​(java.lang.Boolean bundleAuditAnalyzerEnabled)
        Sets if the Bundle Audit Analyzer is enabled.
        Parameters:
        bundleAuditAnalyzerEnabled - whether or not the analyzer should be enabled
      • setBundleAuditPath

        public void setBundleAuditPath​(java.lang.String bundleAuditPath)
        Sets the path to the bundle audit executable.
        Parameters:
        bundleAuditPath - the path to the bundle audit executable
      • setBundleAuditWorkingDirectory

        public void setBundleAuditWorkingDirectory​(java.lang.String bundleAuditWorkingDirectory)
        Sets the path to the working directory that the bundle audit executable should be executed from.
        Parameters:
        bundleAuditWorkingDirectory - the path to the working directory that the bundle audit executable should be executed from.
      • setCocoapodsAnalyzerEnabled

        public void setCocoapodsAnalyzerEnabled​(java.lang.Boolean cocoapodsAnalyzerEnabled)
        Sets whether or not the cocoapods analyzer is enabled.
        Parameters:
        cocoapodsAnalyzerEnabled - the state of the cocoapods analyzer
      • setCarthageAnalyzerEnabled

        public void setCarthageAnalyzerEnabled​(java.lang.Boolean carthageAnalyzerEnabled)
        Sets whether or not the Carthage analyzer is enabled.
        Parameters:
        carthageAnalyzerEnabled - the state of the Carthage analyzer
      • setSwiftPackageManagerAnalyzerEnabled

        public void setSwiftPackageManagerAnalyzerEnabled​(java.lang.Boolean swiftPackageManagerAnalyzerEnabled)
        Sets the enabled state of the swift package manager analyzer.
        Parameters:
        swiftPackageManagerAnalyzerEnabled - the enabled state of the swift package manager
      • setSwiftPackageResolvedAnalyzerEnabled

        public void setSwiftPackageResolvedAnalyzerEnabled​(java.lang.Boolean swiftPackageResolvedAnalyzerEnabled)
        Sets the enabled state of the swift package manager analyzer.
        Parameters:
        swiftPackageResolvedAnalyzerEnabled - the enabled state of the swift package resolved analyzer
      • setOpensslAnalyzerEnabled

        public void setOpensslAnalyzerEnabled​(java.lang.Boolean opensslAnalyzerEnabled)
        Set the value of opensslAnalyzerEnabled.
        Parameters:
        opensslAnalyzerEnabled - new value of opensslAnalyzerEnabled
      • setNodeAnalyzerEnabled

        public void setNodeAnalyzerEnabled​(java.lang.Boolean nodeAnalyzerEnabled)
        Set the value of nodeAnalyzerEnabled.
        Parameters:
        nodeAnalyzerEnabled - new value of nodeAnalyzerEnabled
      • setNodeAuditAnalyzerEnabled

        public void setNodeAuditAnalyzerEnabled​(java.lang.Boolean nodeAuditAnalyzerEnabled)
        Set the value of nodeAuditAnalyzerEnabled.
        Parameters:
        nodeAuditAnalyzerEnabled - new value of nodeAuditAnalyzerEnabled
      • setYarnAuditAnalyzerEnabled

        public void setYarnAuditAnalyzerEnabled​(java.lang.Boolean yarnAuditAnalyzerEnabled)
        Set the value of yarnAuditAnalyzerEnabled.
        Parameters:
        yarnAuditAnalyzerEnabled - new value of yarnAuditAnalyzerEnabled
      • setPnpmAuditAnalyzerEnabled

        public void setPnpmAuditAnalyzerEnabled​(java.lang.Boolean pnpmAuditAnalyzerEnabled)
        Set the value of pnpmAuditAnalyzerEnabled.
        Parameters:
        pnpmAuditAnalyzerEnabled - new value of pnpmAuditAnalyzerEnabled
      • setNodeAuditAnalyzerUseCache

        public void setNodeAuditAnalyzerUseCache​(java.lang.Boolean nodeAuditAnalyzerUseCache)
        Set the value of nodeAuditAnalyzerUseCache.
        Parameters:
        nodeAuditAnalyzerUseCache - new value of nodeAuditAnalyzerUseCache
      • setNodePackageSkipDevDependencies

        public void setNodePackageSkipDevDependencies​(java.lang.Boolean nodePackageSkipDevDependencies)
        Set the value of nodePackageSkipDevDependencies.
        Parameters:
        nodePackageSkipDevDependencies - new value of nodePackageSkipDevDependencies
      • setNodeAuditSkipDevDependencies

        public void setNodeAuditSkipDevDependencies​(java.lang.Boolean nodeAuditSkipDevDependencies)
        Set the value of nodeAuditSkipDevDependencies.
        Parameters:
        nodeAuditSkipDevDependencies - new value of nodeAuditSkipDevDependencies
      • setRetirejsFilterNonVulnerable

        public void setRetirejsFilterNonVulnerable​(java.lang.Boolean retirejsFilterNonVulnerable)
        Set the value of retirejsFilterNonVulnerable.
        Parameters:
        retirejsFilterNonVulnerable - new value of retirejsFilterNonVulnerable
      • addConfiguredRetirejsFilter

        public void addConfiguredRetirejsFilter​(RetirejsFilter retirejsFilter)
        Add a regular expression to the set of retire JS content filters.

        This is called by Ant.

        Parameters:
        retirejsFilter - the regular expression used to filter based on file content
      • setRubygemsAnalyzerEnabled

        public void setRubygemsAnalyzerEnabled​(java.lang.Boolean rubygemsAnalyzerEnabled)
        Set the value of rubygemsAnalyzerEnabled.
        Parameters:
        rubygemsAnalyzerEnabled - new value of rubygemsAnalyzerEnabled
      • setPyPackageAnalyzerEnabled

        public void setPyPackageAnalyzerEnabled​(java.lang.Boolean pyPackageAnalyzerEnabled)
        Set the value of pyPackageAnalyzerEnabled.
        Parameters:
        pyPackageAnalyzerEnabled - new value of pyPackageAnalyzerEnabled
      • setPyDistributionAnalyzerEnabled

        public void setPyDistributionAnalyzerEnabled​(java.lang.Boolean pyDistributionAnalyzerEnabled)
        Set the value of pyDistributionAnalyzerEnabled.
        Parameters:
        pyDistributionAnalyzerEnabled - new value of pyDistributionAnalyzerEnabled
      • setMixAuditAnalyzerEnabled

        public void setMixAuditAnalyzerEnabled​(java.lang.Boolean mixAuditAnalyzerEnabled)
        Set the value of mixAuditAnalyzerEnabled.
        Parameters:
        mixAuditAnalyzerEnabled - new value of mixAuditAnalyzerEnabled
      • setMixAuditPath

        public void setMixAuditPath​(java.lang.String mixAuditPath)
        Sets the path to the mix audit executable.
        Parameters:
        mixAuditPath - the path to the bundle audit executable
      • setCentralAnalyzerEnabled

        public void setCentralAnalyzerEnabled​(java.lang.Boolean centralAnalyzerEnabled)
        Set the value of centralAnalyzerEnabled.
        Parameters:
        centralAnalyzerEnabled - new value of centralAnalyzerEnabled
      • setCentralAnalyzerUseCache

        public void setCentralAnalyzerUseCache​(java.lang.Boolean centralAnalyzerUseCache)
        Set the value of centralAnalyzerUseCache.
        Parameters:
        centralAnalyzerUseCache - new value of centralAnalyzerUseCache
      • setNexusAnalyzerEnabled

        public void setNexusAnalyzerEnabled​(java.lang.Boolean nexusAnalyzerEnabled)
        Set the value of nexusAnalyzerEnabled.
        Parameters:
        nexusAnalyzerEnabled - new value of nexusAnalyzerEnabled
      • setGolangDepEnabled

        public void setGolangDepEnabled​(java.lang.Boolean golangDepEnabled)
        Set the value of golangDepEnabled.
        Parameters:
        golangDepEnabled - new value of golangDepEnabled
      • setGolangModEnabled

        public void setGolangModEnabled​(java.lang.Boolean golangModEnabled)
        Set the value of golangModEnabled.
        Parameters:
        golangModEnabled - new value of golangModEnabled
      • setDartAnalyzerEnabled

        public void setDartAnalyzerEnabled​(java.lang.Boolean dartAnalyzerEnabled)
        Set the value of dartAnalyzerEnabled.
        Parameters:
        dartAnalyzerEnabled - new value of dartAnalyzerEnabled
      • setPathToYarn

        public void setPathToYarn​(java.lang.String pathToYarn)
        Set the value of pathToYarn.
        Parameters:
        pathToYarn - new value of pathToYarn
      • setPathToPnpm

        public void setPathToPnpm​(java.lang.String pathToPnpm)
        Set the value of pathToPnpm.
        Parameters:
        pathToPnpm - new value of pathToPnpm
      • setPathToGo

        public void setPathToGo​(java.lang.String pathToGo)
        Set the value of pathToGo.
        Parameters:
        pathToGo - new value of pathToGo
      • setNexusUrl

        public void setNexusUrl​(java.lang.String nexusUrl)
        Set the value of nexusUrl.
        Parameters:
        nexusUrl - new value of nexusUrl
      • setNexusUser

        public void setNexusUser​(java.lang.String nexusUser)
        Set the value of nexusUser.
        Parameters:
        nexusUser - new value of nexusUser
      • setNexusPassword

        public void setNexusPassword​(java.lang.String nexusPassword)
        Set the value of nexusPassword.
        Parameters:
        nexusPassword - new value of nexusPassword
      • setNexusUsesProxy

        public void setNexusUsesProxy​(java.lang.Boolean nexusUsesProxy)
        Set the value of nexusUsesProxy.
        Parameters:
        nexusUsesProxy - new value of nexusUsesProxy
      • setZipExtensions

        public void setZipExtensions​(java.lang.String zipExtensions)
        Set the value of zipExtensions.
        Parameters:
        zipExtensions - new value of zipExtensions
      • setPathToDotnetCore

        public void setPathToDotnetCore​(java.lang.String pathToCore)
        Set the value of pathToCore.
        Parameters:
        pathToCore - new value of pathToCore
      • setOssindexAnalyzerEnabled

        public void setOssindexAnalyzerEnabled​(java.lang.Boolean ossindexAnalyzerEnabled)
        Set value of ossindexAnalyzerEnabled.
        Parameters:
        ossindexAnalyzerEnabled - new value of ossindexAnalyzerEnabled
      • setOssindexAnalyzerUseCache

        public void setOssindexAnalyzerUseCache​(java.lang.Boolean ossindexAnalyzerUseCache)
        Set value of ossindexAnalyzerUseCache.
        Parameters:
        ossindexAnalyzerUseCache - new value of ossindexAnalyzerUseCache
      • setOssindexAnalyzerUrl

        public void setOssindexAnalyzerUrl​(java.lang.String ossindexAnalyzerUrl)
        Set value of ossindexAnalyzerUrl.
        Parameters:
        ossindexAnalyzerUrl - new value of ossindexAnalyzerUrl
      • setOssindexAnalyzerUsername

        public void setOssindexAnalyzerUsername​(java.lang.String ossindexAnalyzerUsername)
        Set value of ossindexAnalyzerUsername.
        Parameters:
        ossindexAnalyzerUsername - new value of ossindexAnalyzerUsername
      • setOssindexAnalyzerPassword

        public void setOssindexAnalyzerPassword​(java.lang.String ossindexAnalyzerPassword)
        Set value of ossindexAnalyzerPassword.
        Parameters:
        ossindexAnalyzerPassword - new value of ossindexAnalyzerPassword
      • setOssIndexWarnOnlyOnRemoteErrors

        public void setOssIndexWarnOnlyOnRemoteErrors​(java.lang.Boolean ossIndexWarnOnlyOnRemoteErrors)
        Set value of ossIndexAnalyzerWarnOnlyOnRemoteErrors.
        Parameters:
        ossIndexWarnOnlyOnRemoteErrors - the value of ossIndexWarnOnlyOnRemoteErrors
      • setCmakeAnalyzerEnabled

        public void setCmakeAnalyzerEnabled​(java.lang.Boolean cmakeAnalyzerEnabled)
        Set the value of cmakeAnalyzerEnabled.
        Parameters:
        cmakeAnalyzerEnabled - new value of cmakeAnalyzerEnabled
      • setArtifactoryAnalyzerEnabled

        public void setArtifactoryAnalyzerEnabled​(java.lang.Boolean artifactoryAnalyzerEnabled)
        Set the value of artifactoryAnalyzerEnabled.
        Parameters:
        artifactoryAnalyzerEnabled - new value of artifactoryAnalyzerEnabled
      • setArtifactoryAnalyzerUrl

        public void setArtifactoryAnalyzerUrl​(java.lang.String artifactoryAnalyzerUrl)
        Set the value of artifactoryAnalyzerUrl.
        Parameters:
        artifactoryAnalyzerUrl - new value of artifactoryAnalyzerUrl
      • setArtifactoryAnalyzerUseProxy

        public void setArtifactoryAnalyzerUseProxy​(java.lang.Boolean artifactoryAnalyzerUseProxy)
        Set the value of artifactoryAnalyzerUseProxy.
        Parameters:
        artifactoryAnalyzerUseProxy - new value of artifactoryAnalyzerUseProxy
      • setArtifactoryAnalyzerParallelAnalysis

        public void setArtifactoryAnalyzerParallelAnalysis​(java.lang.Boolean artifactoryAnalyzerParallelAnalysis)
        Set the value of artifactoryAnalyzerParallelAnalysis.
        Parameters:
        artifactoryAnalyzerParallelAnalysis - new value of artifactoryAnalyzerParallelAnalysis
      • setArtifactoryAnalyzerUsername

        public void setArtifactoryAnalyzerUsername​(java.lang.String artifactoryAnalyzerUsername)
        Set the value of artifactoryAnalyzerUsername.
        Parameters:
        artifactoryAnalyzerUsername - new value of artifactoryAnalyzerUsername
      • setArtifactoryAnalyzerApiToken

        public void setArtifactoryAnalyzerApiToken​(java.lang.String artifactoryAnalyzerApiToken)
        Set the value of artifactoryAnalyzerApiToken.
        Parameters:
        artifactoryAnalyzerApiToken - new value of artifactoryAnalyzerApiToken
      • setArtifactoryAnalyzerBearerToken

        public void setArtifactoryAnalyzerBearerToken​(java.lang.String artifactoryAnalyzerBearerToken)
        Set the value of artifactoryAnalyzerBearerToken.
        Parameters:
        artifactoryAnalyzerBearerToken - new value of artifactoryAnalyzerBearerToken
      • setFailBuildOnUnusedSuppressionRule

        public void setFailBuildOnUnusedSuppressionRule​(boolean failBuildOnUnusedSuppressionRule)
        Set the value of failBuildOnUnusedSuppressionRule.
        Parameters:
        failBuildOnUnusedSuppressionRule - new value of failBuildOnUnusedSuppressionRule
      • executeWithContextClassloader

        protected void executeWithContextClassloader()
                                              throws org.apache.tools.ant.BuildException
        Description copied from class: Update
        Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.
        Overrides:
        executeWithContextClassloader in class Update
        Throws:
        org.apache.tools.ant.BuildException - thrown if a connection to the local database cannot be made.
      • populateSettings

        protected void populateSettings()
                                 throws org.apache.tools.ant.BuildException
        Takes the properties supplied and updates the dependency-check settings. Additionally, this sets the system properties required to change the proxy server, port, and connection timeout.
        Overrides:
        populateSettings in class Update
        Throws:
        org.apache.tools.ant.BuildException - thrown when an invalid setting is configured.