# Jenkins

### How to integrate Meterian with a Jenkins task

The integration of Meterian with a Jenkins task is very simple and it requires just a couple of steps:

* First of all set METERIAN\_API\_TOKEN as environment variable. Environment variable can be set on Configure System from Manage Jenkins.

{% hint style="info" %}
To retrieve a Meterian API Token visit the [Meterian Dashboard](https://www.meterian.com/account); in your account select the tab "Tokens" and create a new one, or use an existing one.

API tokens are available only on paid account. To upgrade your subscription, please [contact us](mailto:support@meterian.io).
{% endhint %}

* On the main build task simply add an extra step, selecting 'Execute shell' from the dropdown menu

![](/files/-M0cL5hwDIwmB0i2QAkk)

And copy/paste this code snippet

```
docker run --rm \
--volume $(pwd):/workspace --env METERIAN_API_TOKEN=$METERIAN_API_TOKEN \
meterian/cli [Meterian CLI Options]
```

Learn more about the Meterian Client [here](/the-client/client.md).

### How does it work

Jenkins docker will download and set the Meterian container, which contains the latest version of the Meterian client and the building tools for all the supported languages, then Meterian will be launched against the project.

Finally, given the result of the scan, the Jenkins task will pass or it will fail.

### Using the Thin client

You can of course also the Thin Java client on Jenkins, which you can download as part of the or  offline. In order for the client to authenticate, as Jenkins is a headless server, please make sure that the METERIAN\_API\_TOKEN variable is loaded or that you are using a valid authorization file (see the "[How does the client authenticate me](/the-client/client/client-auth.md)" section).

```
curl -s "https://www.meterian.io/downloads/meterian-cli.jar" -o /tmp/meterian-cli.jar
java -jar /tmp/meterian-cli.jar
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.meterian.io/ci-server-integrations/jenkins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
