Meterian
Search…
⌃K

Sample Java Project

Using the Meterian docker image for a specific build step
A sample project based on Java is available on GitLab. This example uses the Meterian Dockerized Client, as the Java scanner requires access to the tooling (in this case the Maven runtime). The specific "latest-java" image is used here, smaller than the standard "latest" as it contains only the Java tooling (the java runtime, Maven, Gradle, Ant).
The YAML configuration for this pipeline is using a standard base image, adding docker and then, inside, using Meterian latest-java docker image to run the analysis:
meterian-analysis:
image: docker:stable
services:
- docker:18.09.7-dind
stage: test
script:
- ROOT=`pwd`
- METERIAN_IMAGE=meterian/cli:latest-java
- docker pull --quiet $METERIAN_IMAGE
- METERIAN_CLI_OPT="--report-console"
- docker run --rm --volume $ROOT:/workspace --env METERIAN_API_TOKEN=$METERIAN_API_TOKEN $METERIAN_IMAGE $METERIAN_CLI_OPT