org.gradle.api.plugins

## Class JavaPluginConvention

- java.lang.Object
- - org.gradle.api.plugins.JavaPluginConvention

-     public class JavaPluginConvention
      extends Object

  Is mixed into the project when applying the `JavaBasePlugin` or the `JavaPlugin`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaPluginConvention(org.gradle.api.internal.project.ProjectInternal project, org.gradle.internal.reflect.Instantiator instantiator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `File` | `getDependencyCacheDir()` Deprecated.
    `String` | `getDependencyCacheDirName()` Deprecated.
    `File` | `getDocsDir()` Returns a file pointing to the root directory supposed to be used for all docs.
    `String` | `getDocsDirName()` The name of the docs directory.
    `org.gradle.api.internal.project.ProjectInternal` | `getProject()`
    `JavaVersion` | `getSourceCompatibility()` Returns the source compatibility used for compiling Java sources.
    `SourceSetContainer` | `getSourceSets()` The source sets container.
    `JavaVersion` | `getTargetCompatibility()` Returns the target compatibility used for compiling Java sources.
    `File` | `getTestReportDir()` Returns a file pointing to the root directory to be used for reports.
    `String` | `getTestReportDirName()` The name of the test reports directory.
    `File` | `getTestResultsDir()` Returns a file pointing to the root directory of the test results.
    `String` | `getTestResultsDirName()` The name of the test results directory.
    `Manifest` | `manifest()` Creates a new instance of a `Manifest`.
    `Manifest` | `manifest(Closure closure)` Creates and configures a new instance of a `Manifest`.
    `void` | `setDependencyCacheDirName(String dependencyCacheDirName)` Deprecated.
    `void` | `setDocsDirName(String docsDirName)`
    `void` | `setProject(org.gradle.api.internal.project.ProjectInternal project)` Deprecated. Project should be considered final.
    `void` | `setSourceCompatibility(JavaVersion value)` Sets the source compatibility used for compiling Java sources.
    `void` | `setSourceCompatibility(Object value)` Sets the source compatibility used for compiling Java sources.
    `void` | `setTargetCompatibility(JavaVersion value)` Sets the target compatibility used for compiling Java sources.
    `void` | `setTargetCompatibility(Object value)` Sets the target compatibility used for compiling Java sources.
    `void` | `setTestReportDirName(String testReportDirName)`
    `void` | `setTestResultsDirName(String testResultsDirName)`
    `Object` | `sourceSets(Closure closure)` Configures the source sets of this project.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaPluginConvention

          public JavaPluginConvention(org.gradle.api.internal.project.ProjectInternal project,
                              org.gradle.internal.reflect.Instantiator instantiator)

  - ### Method Detail

    - #### sourceSets

          public Object sourceSets(Closure closure)

      Configures the source sets of this project.

      The given closure is executed to configure the `SourceSetContainer`. The `SourceSetContainer` is passed to the closure as its delegate.

      See the example below how `SourceSet` 'main' is accessed and how the `SourceDirectorySet` 'java' is configured to exclude some package from compilation.

           apply plugin: 'java'

           sourceSets {
             main {
               java {
                 exclude 'some/unwanted/package/**'
               }
             }
           }

      Parameters:
        `closure` - The closure to execute.
      Returns:
        NamedDomainObjectContainer

    - #### getDependencyCacheDir

          @Deprecated
          public File getDependencyCacheDir()

      Deprecated.

    - #### getDocsDir

          public File getDocsDir()

      Returns a file pointing to the root directory supposed to be used for all docs.

    - #### getTestResultsDir

          public File getTestResultsDir()

      Returns a file pointing to the root directory of the test results.

    - #### getTestReportDir

          public File getTestReportDir()

      Returns a file pointing to the root directory to be used for reports.

    - #### getSourceCompatibility

          public JavaVersion getSourceCompatibility()

      Returns the source compatibility used for compiling Java sources.

    - #### setSourceCompatibility

          public void setSourceCompatibility(Object value)

      Sets the source compatibility used for compiling Java sources.

    - #### setSourceCompatibility

          public void setSourceCompatibility(JavaVersion value)

      Sets the source compatibility used for compiling Java sources.

    - #### getTargetCompatibility

          public JavaVersion getTargetCompatibility()

      Returns the target compatibility used for compiling Java sources.

    - #### setTargetCompatibility

          public void setTargetCompatibility(Object value)

      Sets the target compatibility used for compiling Java sources.

    - #### setTargetCompatibility

          public void setTargetCompatibility(JavaVersion value)

      Sets the target compatibility used for compiling Java sources.

    - #### manifest

          public Manifest manifest()

      Creates a new instance of a `Manifest`.

    - #### manifest

          public Manifest manifest(Closure closure)

      Creates and configures a new instance of a `Manifest`. The given closure configures the new manifest instance before it is returned.
      Parameters:
        `closure` - The closure to use to configure the manifest.

    - #### getDependencyCacheDirName

          @Deprecated
          public String getDependencyCacheDirName()

      Deprecated.
      The name of the dependency cache dir.

    - #### setDependencyCacheDirName

          @Deprecated
          public void setDependencyCacheDirName(String dependencyCacheDirName)

      Deprecated.

    - #### getDocsDirName

          public String getDocsDirName()

      The name of the docs directory. Can be a name or a path relative to the build dir.

    - #### setDocsDirName

          public void setDocsDirName(String docsDirName)

    - #### getTestResultsDirName

          public String getTestResultsDirName()

      The name of the test results directory. Can be a name or a path relative to the build dir.

    - #### setTestResultsDirName

          public void setTestResultsDirName(String testResultsDirName)

    - #### getTestReportDirName

          public String getTestReportDirName()

      The name of the test reports directory. Can be a name or a path relative to `ReportingExtension.getBaseDir()`.

    - #### setTestReportDirName

          public void setTestReportDirName(String testReportDirName)

    - #### getSourceSets

          public SourceSetContainer getSourceSets()

      The source sets container.

    - #### getProject

          public org.gradle.api.internal.project.ProjectInternal getProject()

    - #### setProject

          @Deprecated
          public void setProject(org.gradle.api.internal.project.ProjectInternal project)

      Deprecated. Project should be considered final.
      project