Search code examples
javajenkinscicdveracode

The Veracode Scan plugin fails due to -filepath is required with no way to set it


Running a Jenkins file using the Veracode plugin to perform an Upload and Scan with Veracode Pipeline, using the recommended snippet generated by the Snippet Generator fails due to:

Parsing error(s):
-filepath is required for the selected action.

I even tried adding filePath as a parameter and that does not add filepath to the arguments and also fails:

withCredentials([usernamePassword(credentialsId: 'veracode-credentials', passwordVariable: 'veracode_password', usernameVariable: 'vercode_api_key')]) {
     veracode applicationName: VERACODE_NAME, canFailJob: true,
     waitForScan: true, unstableBuild: true, createSandbox: true,
     debug: true, deleteIncompleteScanLevel: '0',
     criticality: 'Medium', fileNamePattern: '',
     replacementPattern: '',
     sandboxName: "${POM_ARTIFACTID}-${params.ENV}",
     scanName: "${VERSION}${REVISION}-${ENV_US_EN}",
     teams: 'Data-Survey/Compiled',
     uploadIncludesPattern: "**/**-${ENV_US_EN}.war",
     scanExcludesPattern: '', scanIncludesPattern: '',
     filePath: "{$env.WORKSPACE}", useProxy: true,
     vid: vercode_api_key, vkey: veracode_password
 }

WARNING: Unknown parameter(s) found for class type
'com.veracode.jenkins.plugin.VeracodePipelineRecorder': filePath
------------------------------------------------------------------------
Upload and Scan with Veracode Pipeline
------------------------------------------------------------------------

[Debug mode is on]

Can Fail Job: true

Show Unstable Status for Failed Policy Evaluation: true

Version information:
VeracodeJavaAPI v23.4.11.2 cUnknown

HPI location: var/lib/jenkins/plugins/veracode-scan/WEB-INF/lib/veracode-scan.jarProcessing files in [local] workspace:
/local2/jenkins/workspace/SVWebAppBuilding arguments. Calling wrapper with arguments: [-action, UploadAndScan, -vid, ********, -vkey, ********, -phost, ********, -pport, ********, -appname, Shoppers Voice (ICOM), -createprofile, false, -teams, Data-Survey/Compiled, -criticality, Medium, -sandboxname, SVWebApp-DEV, -createsandbox, true, -version, 2.0-SNAPSHOT-us_en_dev, -autoscan, true, -deleteincompletescan, 0, -maxretrycount, 5, -debug, -useragent, VeracodeScanJenkins/23.7.22.0 (Jenkins/2.401.3; Java/Unknown)]

VeracodeJavaAPI v23.4.11.2 cUnknown

Parsing error(s):
-filepath is required for the selected action.

The following parameters are optional for the selected action:
-autorecreate -exclude
-format -include
-includenewmodules -inputfilepath
-logfilepath -pattern
-ppassword -puser
-replacement -sandboxid
-scanallnonfataltoplevelmodules -scanpollinginterval
-scantimeout -selected
-selectedpreviously -toplevel

[2023.08.24 13:26:00.499] Invalid input

Error- Returned code from wrapper:1

Does anyone know how to resolve this? However, it looks like a bug in the plugin to me :(


Solution

  • It turns out that the actual error was that Veracode was not able to find the artifact to scan as it didn't exist.

    The Jenkins pipeline in question builds several artifacts and only checkes 1, it builds 3 artifacts for different country/language combinations -- it's an old application the includes different property files during the build for each country/language combination :/