> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/sast-and-sca/ocular/jenkins.md).

# Jenkins Plugin

The Jenkins plugin for Ocular allows you to automate code analysis during the build process using Ocular.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

This article assumes that you have [installed Jenkins](https://jenkins.io/download/) and have an existing Pipeline project.

## Setting Up the Jenkins Plugin for Ocular <a href="#setting-up-the-jenkins-plugin-for-ocular" id="setting-up-the-jenkins-plugin-for-ocular"></a>

[Download](https://app.shiftleft.io/download/sl-ocular-scan.hpi) the sl-ocular-scan plugin and [upload](https://jenkins.io/doc/book/managing/plugins/#from-the-web-ui) it to your environment.

Next, set Jenkins to run Ocular as a final build step in a Pipeline project by adding the following to your Jenkinsfile:

```
pipeline {
  agent any
      stages {
         stage('Ocular Scan') {
            steps {
               slOcularScan(
                  artifact: "ARTIFACT_URL",
                  threadFix: false,
                  debug: true,
                  ocularArgs: "-J-Xmx4000m",
                  orgId: "ORG_ID",
                  accessToken: "ACCESS_TOKEN"
               )
            }
         }
      }
  }
}
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

Note that `slOcularScan` requires several parameters; be sure to change them as appropriate during configuration:

| Parameter     | Description                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `artifact`    | The link to the file you want analyzed                                                                                    |
| `threadFix`   | **Optional.** Whether you want a [ThreadFix](https://threadfix.it/) file generated                                        |
| `debug`       | **Optional.** Whether you want debugging information                                                                      |
| `ocularArgs`  | **Optional.** Any parameters you want included in your command to run Ocular                                              |
| `orgId`       | Your Qwiet Organization ID. Can be found in the Dashboard under [Account Settings](https://app.shiftleft.io/user/profile) |
| `accessToken` | Your Qwiet Access Token. Can be found in the Dashboard under [Account Settings](https://app.shiftleft.io/user/profile)    |

Once you've configured the plugin, you can run a build to see the results.
