Package: org.gradle.api.plugins

## [Java] Class JavaPluginConvention

- org.gradle.api.plugins.JavaPluginConvention

- 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)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `File` | `getDependencyCacheDir()`
    `String` | `getDependencyCacheDirName()` The name of the dependency cache dir.
    `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(groovy.lang.Closure closure)` Creates and configures a new instance of a Manifest.
    `void` | `setDependencyCacheDirName(String dependencyCacheDirName)`
    `void` | `setDocsDirName(String docsDirName)`
    `void` | `setProject(org.gradle.api.internal.project.ProjectInternal project)` project
    `void` | `setSourceCompatibility(Object value)` Sets the source 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(groovy.lang.Closure closure)` Configures the source sets of this project.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class groovy.lang.GroovyObjectSupport` | `groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

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

  - ### Method Detail

    - #### public File getDependencyCacheDir()

    - #### public String getDependencyCacheDirName()

      The name of the dependency cache dir.

    - #### public File getDocsDir()

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

    - #### public String getDocsDirName()

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

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

    - #### public JavaVersion getSourceCompatibility()

      Returns the source compatibility used for compiling Java sources.

    - #### public SourceSetContainer getSourceSets()

      The source sets container.

    - #### public JavaVersion getTargetCompatibility()

      Returns the target compatibility used for compiling Java sources.

    - #### public File getTestReportDir()

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

    - #### public String getTestReportDirName()

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

    - #### public File getTestResultsDir()

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

    - #### public String getTestResultsDirName()

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

    - #### public Manifest manifest()

      Creates a new instance of a Manifest.

    - #### public Manifest manifest(groovy.lang.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.

    - #### public void setDependencyCacheDirName(String dependencyCacheDirName)

    - #### public void setDocsDirName(String docsDirName)

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

      project

      deprecated:
        Project should be considered final.

    - #### public void setSourceCompatibility(Object value)

      Sets the source compatibility used for compiling Java sources.

      value:
        The value for the source compatibility as defined by JavaVersion.toVersion

    - #### public void setTargetCompatibility(Object value)

      Sets the target compatibility used for compiling Java sources.

      value:
        The value for the target compatibilty as defined by JavaVersion.toVersion

    - #### public void setTestReportDirName(String testReportDirName)

    - #### public void setTestResultsDirName(String testResultsDirName)

    - #### public Object sourceSets(groovy.lang.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