The following steps will assume Jenkins is setup as a Master with a Slave on another machine to execute the job's build and run ZAP
Create aNew Item
- Open Jenkins
- New Item
- Name: ZAP_EXAMPLE_JOB
- Type: Freestyle project
- Go to the Job Summary Page
- Restrict where this project can be run (True)
Name of Slave where ZAP is installed
New Empty workspace will be created on the Slave e.g. C:\Users\<USER_ID>\Jenkins\workspace\ZAP_EXAMPLE_JOB
Configure the Job to Execute ZAP
Add Build StepExecute ZAP
The workspace directory will be shown there.
Override the default ZAP host (e.g. "localhost") and default ZAP port (e.g. "8090") for this job.
Run as Pre-Build Step ( Leave unchecked)
Select the JDK used by ZAP ( Leave as inheritFromJob)