通过命令行的 Checkmarx 扫描抛出错误

Checkmarx scan through commandline is throwing errors

我正在使用以下命令行启动 Checkmarx 扫描。

 runCxConsole Scan -v -CxServer "http://IP"  -projectName "test\Project" -CxUser "domain\username" -CxPassword "password" -Locationtype "TFS" LocationPath "$/TFSRepo/test/Main" -LocationURL "http://tfs.domain.test:8080/tfs" -LocationUser "username@domain.com" -LocationPassword "pasword" -preset "Testpreset"

不幸的是,它不工作,我收到以下错误

 [2020-02-13 11:47:06,901 INFO ] Verbose mode is activated. All messages and events will be sent to 
 the console or log file.
 [2020-02-13 11:47:06,901 INFO ] CxConsole version 8.90.2
 [2020-02-13 11:47:06,917 INFO ] CxConsole scan session started
 [2020-02-13 11:47:06,917 INFO ]
 [2020-02-13 11:47:06,917 INFO ] Default configuration file location: C:\CxConsolePlugin- 
 8.90.2\CxConsolePlugin-8.90.2\config\cx_console.properties
 [2020-02-13 11:47:07,495 FATAL] java.lang.ExceptionInInitializerError: Unable to parse due to 
 missing or incorrect parameters. Recheck the provided parameters and try again.
 [2020-02-13 11:47:07,495 ERROR] Failure - General error occurred - error code 1

您在 LocationPath 中遗漏了“-”,这就是它未被识别为正确参数的原因,同时请确保此命令之间没有多余的 space。 (你在 -projectName 之前给了一个额外的 space 它会在命令行中抛出错误)。

传递这个命令

runCxConsole Scan -v -CxServer "http://IP" -projectName "test\Project" -CxUser "domain\username" -CxPassword "password" -Locationtype "TFS" -LocationPath "$/TFSRepo/test/Main" -LocationURL "http://tfs.domain.test:8080/tfs" -LocationUser "username@domain.com" -LocationPassword "pasword" -preset "Testpreset"