简体   繁体   English

无法访问 jar 文件 azure devops

[英]Unable to access jar file azure devops

I am tryting to launch a ZAP scan from Azure devops with the following code我正在尝试使用以下代码从 Azure devops 启动 ZAP 扫描

trigger:
- main

pool:
 name: Owasp-Zap Agent
  
steps:
- task: CmdLine@2
  inputs:
    script: 'cd C:\Program Files\OWASP\Zed Attack Proxy'
- task: CmdLine@2
  inputs:
    script: 'java -jar zap-2.11.1.jar -cmd -quickurl https://example.com/ -quickout owaspreport.html'

I have tried all the variations from here , none of them work.我已经尝试了这里的所有变体,它们都不起作用。 I have made the azure agent logon as the only admin account on the VM as well.我也将 azure 代理登录为 VM 上的唯一管理员帐户。 Doesn't seem to work.似乎不起作用。

This is the error I keep getting这是我不断收到的错误

"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\agent_work_temp\1466a487-8040-4394-970e-ac3ba154a3d6.cmd"" Error: Unable to access jarfile zap-2.11.1.jar "C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\agent_work_temp\1466a487-8040-4394-970e-ac3ba154a3d6.cmd"" 错误:无法访问jarfile zap-2.11.1.jar

even when it is in the same folder.即使它在同一个文件夹中。

I needed to just add the workingDirectory parameter like so我只需要像这样添加workingDirectory参数

- script: # script path or inline
  workingDirectory: C:\Program Files\OWASP\Zed Attack Proxy

It wasn't a permission issue or anything.这不是许可问题或任何东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM