# Interface RepositoryContentDescriptor

All Superinterfaces:
  `InclusiveRepositoryContentDescriptor`

All Known Subinterfaces:
  `MavenRepositoryContentDescriptor`

public interface RepositoryContentDescriptor extends InclusiveRepositoryContentDescriptor

Descriptor of a repository content, used to avoid reaching to an external repository when not needed.

Excludes are applied after includes. This means that by default, everything is included and nothing excluded. If includes are added, then if the module doesn't match any of the includes, it's excluded. Then if it does, but it also matches one of the excludes, it's also excluded.

Since:
  5.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `excludeGroup(String group)`
  Declares that an entire group shouldn't be searched for in this repository.
  `void`
  `excludeGroupAndSubgroups(String groupPrefix)`
  Declares that an entire group and its subgroups shouldn't be searched for in this repository.
  `void`
  `excludeGroupByRegex(String groupRegex)`
  Declares that an entire group shouldn't be searched for in this repository.
  `void`
  `excludeModule(String group, String moduleName)`
  Declares that an entire module shouldn't be searched for in this repository.
  `void`
  `excludeModuleByRegex(String groupRegex, String moduleNameRegex)`
  Declares that an entire module shouldn't be searched for in this repository, using regular expressions.
  `void`
  `excludeVersion(String group, String moduleName, String version)`
  Declares that a specific module version shouldn't be searched for in this repository.
  `void`
  `excludeVersionByRegex(String groupRegex, String moduleNameRegex, String versionRegex)`
  Declares that a specific module version shouldn't be searched for in this repository, using regular expressions.
  `void`
  `notForConfigurations(@Nullable String... configurationNames)`
  Declares that this repository should not be used for a specific set of configurations.
  `<T> void`
  `onlyForAttribute(Attribute<T> attribute, T... validValues)`
  Declares that this repository will only be searched if the consumer requires a specific attribute.
  `void`
  `onlyForConfigurations(@Nullable String... configurationNames)`
  Declares that this repository should only be used for a specific set of configurations.

  ### Methods inherited from interface InclusiveRepositoryContentDescriptor

  `includeGroup, includeGroupAndSubgroups, includeGroupByRegex, includeModule, includeModuleByRegex, includeVersion, includeVersionByRegex`

- ## Method Details

  - ### excludeGroup

    void excludeGroup(String group)
    Declares that an entire group shouldn't be searched for in this repository.
    Parameters:
      `group` - the group name
    Since:
      5.1

  - ### excludeGroupAndSubgroups

    @Incubating void excludeGroupAndSubgroups(String groupPrefix)
    Declares that an entire group and its subgroups shouldn't be searched for in this repository.

    A subgroup is a group that starts with the given prefix and has a dot immediately after the prefix. For example, if the prefix is `org.gradle`, then `org.gradle` is matched as a group, and `org.gradle.foo` and `org.gradle.foo.bar` are matched as subgroups. `org.gradlefoo` is not matched as a subgroup.

    Parameters:
      `groupPrefix` - the group prefix to include
    Since:
      8.1

  - ### excludeGroupByRegex

    void excludeGroupByRegex(String groupRegex)
    Declares that an entire group shouldn't be searched for in this repository.
    Parameters:
      `groupRegex` - the group name regular expression
    Since:
      5.1

  - ### excludeModule

    void excludeModule(String group, String moduleName)
    Declares that an entire module shouldn't be searched for in this repository.
    Parameters:
      `group` - the group name
      `moduleName` - the module name
    Since:
      5.1

  - ### excludeModuleByRegex

    void excludeModuleByRegex(String groupRegex, String moduleNameRegex)
    Declares that an entire module shouldn't be searched for in this repository, using regular expressions.
    Parameters:
      `groupRegex` - the group name regular expression
      `moduleNameRegex` - the module name regular expression
    Since:
      5.1

  - ### excludeVersion

    void excludeVersion(String group, String moduleName, String version)
    Declares that a specific module version shouldn't be searched for in this repository.

    The version notation for a regex will be matched against a single version and does not support range notations.

    Parameters:
      `group` - the group name
      `moduleName` - the module name
      `version` - the module version
    Since:
      5.1

  - ### excludeVersionByRegex

    void excludeVersionByRegex(String groupRegex, String moduleNameRegex, String versionRegex)
    Declares that a specific module version shouldn't be searched for in this repository, using regular expressions.

    The version notation for a regex will be matched against a single version and does not support range notations.

    Parameters:
      `groupRegex` - the group name
      `moduleNameRegex` - the module name
      `versionRegex` - the module version
    Since:
      5.1

  - ### onlyForConfigurations

    void onlyForConfigurations(@Nullable String... configurationNames)
    Declares that this repository should only be used for a specific set of configurations. Defaults to any configuration
    Parameters:
      `configurationNames` - the names of the configurations the repository will be used for
    Since:
      5.1

  - ### notForConfigurations

    void notForConfigurations(@Nullable String... configurationNames)
    Declares that this repository should not be used for a specific set of configurations. Defaults to any configuration
    Parameters:
      `configurationNames` - the names of the configurations the repository will not be used for
    Since:
      5.1

  - ### onlyForAttribute

    <T> void onlyForAttribute(Attribute<T> attribute, T... validValues)
    Declares that this repository will only be searched if the consumer requires a specific attribute.
    Type Parameters:
      `T` - the type of the attribute
    Parameters:
      `attribute` - the attribute
      `validValues` - the list of accepted values
    Since:
      5.1