JavaResolutionConsistency (Gradle API 9.0.0)
Description: declaration: package: org.gradle.api.plugins, interface: JavaResolutionConsistency

Package org.gradle.api.plugins

# Interface JavaResolutionConsistency

@Incubating public interface JavaResolutionConsistency
Dependency resolution consistency configuration for the Java derived plugins.

Since:
  6.8

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `useCompileClasspathVersions()`
  Configures the runtime classpath of every source set to be consistent with the compile classpath.
  `void`
  `useRuntimeClasspathVersions()`
  Configures the compile classpath of every source set to be consistent with the runtime classpath.

- ## Method Details

  - ### useCompileClasspathVersions

    void useCompileClasspathVersions()
    Configures the runtime classpath of every source set to be consistent with the compile classpath. For dependencies which are common between the compile classpath and the runtime classpath, the version from the compile classpath is going to be used. Unless you have a good reason to, this option should be preferred to `useRuntimeClasspathVersions()` for different reasons:
    - As code is compiled first against the given dependencies, it is expected that the versions at runtime would be the same.
    - It avoids resolving the runtime classpath in case of a compile error.
    In addition, the compile classpath for each test suite will be configured to be consistent with the main feature's compile classpath.

  - ### useRuntimeClasspathVersions

    void useRuntimeClasspathVersions()
    Configures the compile classpath of every source set to be consistent with the runtime classpath. For dependencies which are common between the compile classpath and the runtime classpath, the version from the runtime classpath is going to be used. In addition, the runtime classpath for each test suite will be configured to be consistent with the main feature's runtime classpath. Prefer `useCompileClasspathVersions()` unless you have special requirements at runtime.