Skip to content

Feature to ban certain dependencies #1069

Open
@ash211

Description

@ash211

What happened?

Occasionally I want to ban a dependency in a repo, and fail gradle checks if it appears in versions.lock.

For example, if I've spent some work to migrate off of a problematic library, I'd like to then add it to a banned list to make sure that it doesn't sneakily re-appear in a repo as a result of some auto-upgrade bump. In my example it's a certain maven coordinate, not a specific version of a coordinate.

What did you want to happen?

Some way to provide a list of deps that cannot be depended on, directly or transitively. For example:

dependencies {
  banned {
    module('com.sun.jersey:jersey-server') {
      because 'Unwanted reason x'
    }
    module('org.glassfish.jersey.core:jersey-server') {
      because 'Unwanted reason y'
    }
    module('ch.qos.logback:logback-core') {
      because 'Unwanted reason z'
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions