Gradle plugin to prevent non-stable versions of dependencies from being inadvertently consumed by a project
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
README.rst
build.gradle
dependencies.lock
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.rst

download https://travis-ci.org/ADTRAN/gradle-betablocker-plugin.svg?branch=master

Betablocker Plugin

This Gradle plugin rejects dependencies (including transitives) whose version string includes a configurable list of patterns. It is intended to be used to block non-stable versions of dependencies from inadvertently being consumed by a project.

Setup

First, add the appropriate buildscript repository and dependency:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath "com.adtran:betablocker-plugin:1.+"
  }
}

Then apply the plugin using either the old style:

apply plugin: "com.adtran.betablocker-plugin"

...or the new style:

plugins {
  id "com.adtran.betablocker-plugin"
}

It's also available via plugins.gradle.org.

Configuration

To configure the plugin, add a block like the following to your build.gradle:

betablocker {
  enabled true
  whitelist = []
  rejectedVersions = ["alpha", "beta", "m", "snap", "latest"]
}

These properties are described in the following table:

Property Type Default Description
enabled Boolean true Set to false to disable the plugin entirely
whitelist List<String> [] A list of strings which if present in the display name of an artifact will prevent the plugin from rejecting any versions
rejectedVersions List<String> ["alpha", "beta", "m", "snap", "latest"] A list of strings which if present in the version of an artifact will cause it to be rejected (case insensitive)

License

This project is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0). Copyright 2018, ADTRAN, Inc.

Contributing

Issues and pull requests are welcome if you have bugs/suggestions/improvements!