All Projects → snyk → snyk-maven-plugin

snyk / snyk-maven-plugin

Licence: other
Test and monitor your projects for vulnerabilities with Maven. This plugin is officially maintained by Snyk.

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects

Projects that are alternatives of or similar to snyk-maven-plugin

mvn scalafmt
Scalafmt plugin for maven
Stars: ✭ 14 (-78.12%)
Mutual labels:  maven, maven-plugin
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+17665.63%)
Mutual labels:  maven, maven-plugin
Flatten Maven Plugin
Flatten Maven Plugin
Stars: ✭ 82 (+28.13%)
Mutual labels:  maven, maven-plugin
macosappbundler-maven-plugin
Maven plugin for creating a native macOS bundle containing all dependencies required by a Maven project
Stars: ✭ 35 (-45.31%)
Mutual labels:  maven, maven-plugin
Formatter Maven Plugin
Formatter Maven Plugin
Stars: ✭ 187 (+192.19%)
Mutual labels:  maven, maven-plugin
Appassembler
Stars: ✭ 69 (+7.81%)
Mutual labels:  maven, maven-plugin
Jgitver Maven Plugin
maven core extension to automatically define versions using jgitver & git tags
Stars: ✭ 117 (+82.81%)
Mutual labels:  maven, maven-plugin
Graphql Java Codegen Maven Plugin
Maven plugin for graphql-java-codegen
Stars: ✭ 17 (-73.44%)
Mutual labels:  maven, maven-plugin
Sortpom
Maven plugin that helps the user sort pom.xml.
Stars: ✭ 185 (+189.06%)
Mutual labels:  maven, maven-plugin
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (+178.13%)
Mutual labels:  maven, maven-plugin
yavdb
Yet Another Vulnerability Database
Stars: ✭ 14 (-78.12%)
Mutual labels:  maven, vulnerabilities
Docker Maven Plugin
INACTIVE: A maven plugin for Docker
Stars: ✭ 2,597 (+3957.81%)
Mutual labels:  maven, maven-plugin
Animal Sniffer
Stars: ✭ 59 (-7.81%)
Mutual labels:  maven, maven-plugin
Git Commit Id Maven Plugin
Maven plugin which includes build-time git repository information into an POJO / *.properties). Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments... :-)
Stars: ✭ 1,187 (+1754.69%)
Mutual labels:  maven, maven-plugin
Rpm Maven Plugin
Stars: ✭ 52 (-18.75%)
Mutual labels:  maven, maven-plugin
Dependency spy
Find known vulnerabilities in your dependencies
Stars: ✭ 87 (+35.94%)
Mutual labels:  maven, vulnerabilities
Javafx Maven Plugin
Maven plugin for JavaFX
Stars: ✭ 764 (+1093.75%)
Mutual labels:  maven, maven-plugin
Maven Min Plugin
📦 Latke application JavaScript and CSS files compression.
Stars: ✭ 5 (-92.19%)
Mutual labels:  maven, maven-plugin
Gatling Maven Plugin Demo
Showcase of the Gatling Plugin for Maven
Stars: ✭ 162 (+153.13%)
Mutual labels:  maven, maven-plugin
Versions Maven Plugin
Versions Maven Plugin
Stars: ✭ 199 (+210.94%)
Mutual labels:  maven, maven-plugin

Snyk Logo

Snyk Maven Plugin

Maven Release Vulnerabilities

Tests and monitors your Maven dependencies for vulnerabilities. This plugin is officially maintained by Snyk.

Installation

  1. Get your Snyk API token.

  2. Add the Snyk Maven Plugin to your pom.xml and configure it as needed.

<!-- Example Plugin Configuration -->
<build>
  <plugins>
    <plugin>
      <groupId>io.snyk</groupId>
      <artifactId>snyk-maven-plugin</artifactId>
      <version>2.0.0</version>
      <inherited>false</inherited>
      <executions>
        <execution>
          <id>snyk-test</id>
          <goals>
            <goal>test</goal>
          </goals>
        </execution>
        <execution>
          <id>snyk-monitor</id>
          <goals>
            <goal>monitor</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <apiToken>${env.SNYK_TOKEN}</apiToken>
        <args>
          <arg>--all-projects</arg>
        </args>
      </configuration>
    </plugin>
  </plugins>
</build>

Supported Versions

  • Java 8 and above.
  • Maven 3.2.5 and above.

Goals

code-test (experimental)

Default phase: test

Performs a static-analysis of your project's source code and provides a list of vulnerabilities if any are found.

container-test (experimental)

Default phase: install

Performs analysis of the layers of a container image. The tag of the image to be scanned should be provided as an argument;

<!-- Example of specifying the tag of the image to scan -->
<configuration>
  <args>
    <arg>--print-deps</arg>
    <arg>nginx:1.9.5</arg>
  </args>
</configuration>

test

Default Phase: test

Scans your project's dependencies and provides a list of vulnerabilities if any are found.

monitor

Default Phase: install

Takes a snapshot of your project's dependency tree and monitors it on snyk.io. You'll be alerted when new relevant vulnerabilities, updates or patches are disclosed.

Configuration

You can configure the following parameters inside the <configuration> section. All parameters are optional.

apiToken [string]

⚠️ Do NOT include your API token directly in your pom.xml. Use a variable instead.

You must provide a Snyk API token to access Snyk's services. You can do so by:

  • Providing apiToken in your configuration using a variable.
  • Providing a SNYK_TOKEN environment variable.
  • Authenticating via snyk auth using the Snyk CLI before using this plugin.

skip [boolean]

Default: false

Skip this execution entirely.

When running mvn, you can also use -Dsnyk.skip to enable this behavior.

failOnIssues [boolean]

Default: true

When set to true then, should the Snyk CLI tool indicate that action is required to remedy a security issue, the Maven build will be considered failed. When set to false the build will continue even if action is required.

args [array<string>]

This plugin uses Snyk CLI so you can pass any supported arguments using <args>. See the example below.

For a list of supported arguments, see Snyk CLI Reference.

<!-- Example Arguments Configuration -->
<configuration>
  <args>
    <arg>--severity-threshold=high</arg>
    <arg>--scan-all-unmanaged</arg>
    <arg>--json</arg>
  </args>
</configuration>

cli [object]

Lets you configure the Snyk CLI that's used by this plugin.

By default, the CLI will be automatically downloaded and updated for you.

See CLI Configuration.

CLI Configuration

⚠️ For most use cases you don't need to set any <cli> options.

You can configure the CLI in three different modes:

Follow the link for each mode to see which parameters are available.

<!-- Example CLI Configuration -->
<configuration>
  <cli>
    <updatePolicy>daily</updatePolicy>
  </cli>
</configuration>

Auto-Download and Update

updatePolicy [string]

Default: daily

How often to download the latest CLI release. Snyk recommends always keeping your CLI installation updated to the latest version. Can be one of the following:

  • daily - On the first execution of the day.
  • always - On every execution.
  • never - Never update after the initial download.
  • interval:<minutes> - On the execution after more than <minutes> has passed since the last update. e.g. interval:60 will update after an hour.

downloadDestination [string]

Default: OS-specific, see below.

Where to place the downloaded executable. By default, this is OS-specific as follows:

  • Linux - $XDG_DATA_HOME/snyk/snyk-linux or ~/.local/share/snyk/snyk-linux
  • macOS - ~/Library/Application Support/Snyk/snyk-macos
  • Windows - %APPDATA%\Snyk\snyk-win.exe

Custom CLI Executable

executable [string]

Example: ~/.local/share/snyk/snyk-linux

Path to a pre-installed Snyk CLI executable. You can find executables on the Snyk CLI Releases page.

Specific CLI Version

version [string]

Example: 1.542.0

Specify if you want to use a specific version. You can find versions on the Snyk CLI Releases page.

Setting this option will trigger a download of the CLI on every execution.

Demonstration

To try out this plugin, see the demo project.

Migrating from Snyk Maven Plugin v1 to v2

All plugin parameters from v1 should be moved to the <args> object, to keep them in line with the CLI usage. For example:

  • org => <arg>--org=my-org-name</arg>
  • failOnSeverity => <arg>--severity-threshold=low|medium|high</arg>
  • failOnAuthError => Use <skip>true</skip> to skip plugin execution.
  • includeProvidedDependencies => provided dependencies are always included.

For a list of supported arguments, see Configuration.


Made with 💜 by Snyk

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].