DependencySubstitutions.Substitution (Gradle API 7.6.3)

Package org.gradle.api.artifacts

## Interface DependencySubstitutions.Substitution

- Enclosing interface:
    DependencySubstitutions

      public static interface DependencySubstitutions.Substitution

  Provides a DSL-friendly mechanism for specifying the target of a substitution.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DependencySubstitutions.Substitution` | `because​(java.lang.String reason)` | Specify a reason for the substitution.
    `DependencySubstitutions.Substitution` | `using​(ComponentSelector notation)` | Specify the target of the substitution.
    `void` | `with​(ComponentSelector notation)` | Deprecated. Use `using(ComponentSelector)` instead.
    `DependencySubstitutions.Substitution` | `withClassifier​(java.lang.String classifier)` | Specifies that the substituted target dependency should use the specified classifier.
    `DependencySubstitutions.Substitution` | `withoutArtifactSelectors()` | Specifies that substituted dependencies must not carry any artifact selector.
    `DependencySubstitutions.Substitution` | `withoutClassifier()` | Specifies that the substituted dependency mustn't have any classifier.

- - ### Method Detail

    - #### because

          DependencySubstitutions.Substitution because​(java.lang.String reason)

      Specify a reason for the substitution. This is optional
      Parameters:
        `reason` - the reason for the selection
      Returns:
        the substitution
      Since:
        4.5

    - #### withClassifier

          DependencySubstitutions.Substitution withClassifier​(java.lang.String classifier)

      Specifies that the substituted target dependency should use the specified classifier. This method assumes that the target dependency is a jar (type jar, extension jar).
      Since:
        6.6

    - #### withoutClassifier

          DependencySubstitutions.Substitution withoutClassifier()

      Specifies that the substituted dependency mustn't have any classifier. It can be used whenever you need to substitute a dependency which uses a classifier into a dependency which doesn't. This method assumes that the target dependency is a jar (type jar, extension jar).
      Since:
        6.6

    - #### withoutArtifactSelectors

          DependencySubstitutions.Substitution withoutArtifactSelectors()

      Specifies that substituted dependencies must not carry any artifact selector.
      Since:
        6.6

    - #### with

          @Deprecated
          void with​(ComponentSelector notation)

      Deprecated.
      Use `using(ComponentSelector)` instead. This method will be removed in Gradle 8.0.
      Specify the target of the substitution.

    - #### using

          DependencySubstitutions.Substitution using​(ComponentSelector notation)

      Specify the target of the substitution. This is a replacement for the `with(ComponentSelector)` method which supports chaining.
      Since:
        6.6