Maven

Dependencies

Some of these commands depends on:

  • mvn
  • dot (graphviz)

Help

Run maven (mvn) commands

Usage:
  ply plugin maven [command]

Available Commands:
  analyze     Perform an analyze on a projects
  boot-run    runs a spring boot application
  checkstyle  runs checkstyle
  enforcer    runs enforcer
  graph       creates a graph using maven for dependencies in a project
  owasp       runs owasp

Flags:
  -h, --help            help for maven
  -r, --recursive       turn on recursive mode
      --target string   optional target directory (default ".")

Global Flags:
      --debug   turn on debug output
      --doc     open documentation website
      --force   uses default for prompts
      --json    turn on json output logging

Use "ply plugin maven [command] --help" for more information about a command.

Graphing

plybuild supports graphing of dependencies through the maven plugin: https://github.com/ferstl/depgraph-maven-plugin

creates a graph using maven for dependencies in a project

Usage:
  ply plugin maven graph [flags]
  ply plugin maven graph [command]

Available Commands:
  2party      creates a graph only for 2party dependencies in a project

Flags:
      --exclude-filters stringArray   exclude filter rules
      --exclude-test-scope            exclude test scope from graph
  -h, --help                          help for graph
      --include-filters stringArray   include filter rules
      --open                          open report in browser

Global Flags:
      --debug           turn on debug output
      --doc             open documentation website
      --force           uses default for prompts
      --json            turn on json output logging
  -r, --recursive       turn on recursive mode
      --target string   optional target directory (default ".")

Use "ply plugin maven graph [command] --help" for more information about a command.

Graph filters

By default, no filters are applied to the graph. However, both exclude and include filter are supported. Both of these filers are proxies for the filters supported by the plugin: https://github.com/ferstl/depgraph-maven-plugin/wiki/Filtering

plybuild plugin maven graph --include-filters="org.springframework*" --include-filters="org.jetbrains*"
plybuild plugin maven graph --exclude-filters="org.springframework*" --exclude-filters="org.jetbrains*"

Graph style

Before generating the graph a style definition file is placed in target/dependency-graph-styles.json. This file is generated with the following defaults (“com.example*” is replaced with the actual groupId of the project):

{
    "node-styles": {
        ",,test": {
            "type": "box",
            "color": "#d2d2d2",
            "fill-color": "#d3d3d3",
            "style": "filled,rounded"
        },
        "com.example*": {
            "type": "box",
            "color": "#95ca7d",
            "fill-color": "#79B4B7",
            "style": "filled,rounded"
        },
        "org.jetbrains*": {
            "type": "box",
            "color": "#F9C5D5",
            "fill-color": "#FEE3EC",
            "style": "filled,rounded"
        },
        "org.springframework*": {
            "type": "box",
            "color": "#95ca7d",
            "fill-color": "#b4d4a1",
            "style": "filled,rounded"
        }
    }
}

If the file already exists in the target folder, it will not be overwritten. More information on this file is found at: https://github.com/ferstl/depgraph-maven-plugin/wiki/Styling