Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.gradle.api.plugins
[Groovy] Class JavaPluginConvention

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

    class JavaPluginConvention

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

Authors:
  Hans Dockter

Property Summary
`String` | `dependencyCacheDirName`
`String` | `docsDirName` The name of the docs directory.
`DefaultManifest` | `manifest`
`List` | `metaInf` Deprecated.
`ProjectInternal` | `project`
`SourceSetContainer` | `sourceSets` The source sets container.
`String` | `testReportDirName` The name of the test reports directory.
`String` | `testResultsDirName` The name of the test results directory.

Constructor Summary
`JavaPluginConvention(Project project)`

Method Summary
`File` | `getDependencyCacheDir()`
`File` | `getDocsDir()` Returns a file pointing to the root directory supposed to be used for all docs.
`JavaVersion` | `getSourceCompatibility()` Returns the source compatibility used for compiling Java sources.
`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.
`File` | `getTestResultsDir()` Returns a file pointing to the root directory of the test results.
`Manifest` | `manifest()` Creates a new instance of a Manifest.
`Manifest` | `manifest(Closure closure)` Creates and configures a new instance of a Manifest.
`void` | `setSourceCompatibility(def value)` Sets the source compatibility used for compiling Java sources.
`void` | `setTargetCompatibility(def value)` Sets the target compatibility used for compiling Java sources.
`def` | `sourceSets(Closure closure)` Configures the source sets of this project.

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Property Detail

### dependencyCacheDirName

    String dependencyCacheDirName

### docsDirName

    String docsDirName

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

### manifest

    @Deprecated
    DefaultManifest manifest

### metaInf

    @Deprecated
    List metaInf

  Deprecated. Please use jar.metaInf instead. The property didn't add much value over the jar's setting and Gradle offers convenient ways of configuring all tasks of given type should someone needed.

  The lines of metaInf file that will be configured by default to every jar task.

### project

    ProjectInternal project

### sourceSets

    final SourceSetContainer sourceSets

  The source sets container.

### testReportDirName

    String testReportDirName

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

### testResultsDirName

    String testResultsDirName

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

Constructor Detail

### JavaPluginConvention

    JavaPluginConvention(Project project)

Method Detail

### getDependencyCacheDir

    File getDependencyCacheDir()

### getDocsDir

    File getDocsDir()

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

### getSourceCompatibility

    JavaVersion getSourceCompatibility()

  Returns the source compatibility used for compiling Java sources.

### getTargetCompatibility

    JavaVersion getTargetCompatibility()

  Returns the target compatibility used for compiling Java sources.

### getTestReportDir

    File getTestReportDir()

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

### getTestResultsDir

    File getTestResultsDir()

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

### manifest

    Manifest manifest()

  Creates a new instance of a Manifest.

### manifest

    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.

### setSourceCompatibility

    void setSourceCompatibility(def value)

  Sets the source compatibility used for compiling Java sources.
  value:
    The value for the source compatibility as defined by JavaVersion#toVersion(Object)#toVersion(Object)

### setTargetCompatibility

    void setTargetCompatibility(def value)

  Sets the target compatibility used for compiling Java sources.
  value:
    The value for the target compatibilty as defined by JavaVersion#toVersion(Object)#toVersion(Object)

### sourceSets

    def 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.

Gradle API 1.1-rc-1