Skip to content

kordamp/jdeprscan-gradle-plugin

Repository files navigation

jdeprscan-gradle-plugin

Build Status Gradle Plugin Portal


Runs the jdeprscan command on the project’s output.

Usage

Option #1

buildscript {
    repositories {
        jcenter()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'org.kordamp.gradle:jdeprscan-gradle-plugin:0.11.0'
    }
}
apply plugin: 'org.kordamp.gradle.jdeprscan'

Option #2

plugins {
    id 'org.kordamp.gradle.jdeprscan' version '0.11.0'
}

This will add a jdeprscanReport task to your build, which will analyze the main sourceSets using the runtimeClasspath configuration by default.

Configuration

Plugin configuration

The following properties can be specified in the jdeprscanReport task configuration

Name Option Property Type Default Value

forRemoval

jdeprscan-for-removal

jdeprscan.for.removal

boolean

false

release

jdeprscan-release

jdeprscan.release

int

9

verbose

jdeprscan-verbose

jdeprscan.verbose

boolean

false

javaHome

jdeprscan-java-home

jdeprscan.java.home

String

consoleOutput

jdeprscan-console-output

jdeprscan.console.output

boolean

true

reportsDir

Directory

"${buildDir}/reports/jdeprscan"

configurations

jdeprscan-configurations

jdeprscan.configurations

List<String>

['runtimeClasspath']

sourceSets

jdeprscan-sourcesets

jdeprscan.sourcesets

List<String>

['main']

Task properties may be defined on the command line using their option name, or their property name, such as

$ gradle jdeprscan --jdeprscan-verbose
$ gradle jdeprscan -Pjdeprscan.verbose=true
$ gradle jdeprscan -Djdeprscan.verbose=true
$ set JDEPRSCAN_VERBOSE=true
$ gradle jdeprscan

You may run this plugin in a build that relies Java 8 as long as you configure a valid path to a JDK9+ installation directory using the javaHome property, for example

jdeprscanReport {
    javaHome = '/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home'
}

You may configure multiple sourceSets and configurations, which will be evaluated in a single report. The following snippet shows how this plugin can be configured to run jdeprscanReport on production and test sources

jdeprscanReport {
    sourceSets = ['main', 'test']
    configurations = ['testRuntimeClasspath']
}