Interface JavaPluginExtension


@Incubating public interface JavaPluginExtension
Common configuration for Java based projects. This is added by the JavaBasePlugin.
Since:
4.10
  • Method Details

    • getSourceCompatibility

      JavaVersion getSourceCompatibility()
      Returns the source compatibility used for compiling Java sources.
    • setSourceCompatibility

      void setSourceCompatibility(JavaVersion value)
      Sets the source compatibility used for compiling Java sources.
      Parameters:
      value - The value for the source compatibility
    • getTargetCompatibility

      JavaVersion getTargetCompatibility()
      Returns the target compatibility used for compiling Java sources.
    • setTargetCompatibility

      void setTargetCompatibility(JavaVersion value)
      Sets the target compatibility used for compiling Java sources.
      Parameters:
      value - The value for the target compatibility
    • registerFeature

      void registerFeature(String name, Action<? super FeatureSpec> configureAction)
      Registers a feature.
      Parameters:
      name - the name of the feature
      configureAction - the configuration for the feature
      Since:
      5.3
    • disableAutoTargetJvm

      @Incubating void disableAutoTargetJvm()
      If this method is called, Gradle will not automatically try to fetch dependencies which have a JVM version compatible with the target compatibility of this module. This should be used whenever the default behavior is not applicable, in particular when for some reason it's not possible to split a module and that this module only has some classes which require dependencies on higher versions.
      Since:
      5.3