# Using the Java Thin client

If you decide to not use the Docker image with your Azure pipeline, you will need to update the configuration file **azure-pipelines.yml** with this small snippet, which will download and invoke the client:

```
steps:
- script: |
    curl -s "https://www.meterian.io/downloads/meterian-cli.jar" -o meterian-cli.jar
  displayName: 'Download Meterian Java thin client'

- script: |
    java -jar meterian-cli.jar
  displayName: 'Run Meterian analysis'
  env:
    METERIAN_API_TOKEN: $(METERIAN_API_TOKEN)
```

The requirement is for the base image to have java installed  (most images do, see the [Azure documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops) for details). A working example of the non-native integration using the Java Thin client can be found [here.](https://dev.azure.com/meterianrocksolid/_git/node-sample-project-thin-client?path=%2Fazure-pipelines.yml)&#x20;

Please remember that, before invoking the client, you will also need to make sure that the relevant tools are installed and configured in your pipeline. So, for example, if you need to analyse a NodeJS project you will need to install, prior to Meterian, the required tooling, like in this example:

```
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js (Meterian will need it as this is a Node project)'
```

Meterian will be launched against the project source code every time a new change is committed and pushed in your repository. Rember to set the METERIAN\_API\_TOKEN environment variable, see the [Azure Devops](/ci-server-integrations/azure-devops.md) section for instructions.

Here's a list of integration examples for every language:

* [Java](https://dev.azure.com/meterianrocksolid/_git/java-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [NodeJS](https://dev.azure.com/meterianrocksolid/_git/node-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [Python](https://dev.azure.com/meterianrocksolid/_git/python-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [PHP](https://dev.azure.com/meterianrocksolid/_git/php-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [GoLang](https://dev.azure.com/meterianrocksolid/_git/go-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [Swift](https://dev.azure.com/meterianrocksolid/_git/swift-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [.NET](https://dev.azure.com/meterianrocksolid/_git/dotnet-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [Ruby](https://dev.azure.com/meterianrocksolid/_git/ruby-sample-project-thin-client?path=%2Fazure-pipelines.yml)
* [Scala](https://dev.azure.com/meterianrocksolid/_git/scala-sample-project-thin-client?path=%2Fazure-pipelines.yml)

## Integration example running on Windows VMs

If your pipeline is running on a windows VM here is an example snippet you should use or refer to

```
trigger:
- main

pool:
 vmImage: 'windows-latest'

steps:
- script: |
    curl.exe -s "https://www.meterian.io/downloads/meterian-cli.jar" -o meterian-cli.jar 
  displayName: 'Download Meterian Java thin client'

- script: |
    java -jar meterian-cli.jar --folder="$(Build.SourcesDirectory)"
  displayName: 'Run Meterian analysis'
  env:
    METERIAN_API_TOKEN: $(METERIAN_API_TOKEN)
```

A live example can also be found [here](https://dev.azure.com/meterianrocksolid/_git/meterian-win-latest-example?path=/azure-pipelines.yml).


---

# 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/azure-devops/using-the-java-thin-client.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.
