Package org.gradle.api.tasks.javadoc

## Class Javadoc

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.api.internal.ConventionTask
      - - org.gradle.api.tasks.SourceTask
        - - org.gradle.api.tasks.javadoc.Javadoc

- All Implemented Interfaces:
    `Comparable<Task>`, `org.gradle.api.internal.DynamicObjectAware`, `org.gradle.api.internal.IConventionAware`, `org.gradle.api.internal.TaskInternal`, `ExtensionAware`, `Task`, `PatternFilterable`, `org.gradle.util.Configurable<Task>`

      @CacheableTask
      public class Javadoc
      extends SourceTask

  Generates HTML API documentation for Java classes.

  If you create your own Javadoc tasks remember to specify the 'source' property! Without source the Javadoc task will not create any documentation. Example:

       apply plugin: 'java'

       task myJavadocs(type: Javadoc) {
         source = sourceSets.main.allJava
       }

  An example how to create a task that runs a custom doclet implementation:

       apply plugin: 'java'

       configurations {
         jaxDoclet
       }

       dependencies {
         //jaxDoclet "some.interesting:Dependency:1.0"
       }

       task generateRestApiDocs(type: Javadoc) {
         source = sourceSets.main.allJava
         destinationDir = reporting.file("rest-api-docs")
         options.docletpath = configurations.jaxDoclet.files.asType(List)
         options.doclet = "com.lunatech.doclets.jax.jaxrs.JAXRSDoclet"
         options.addStringOption("jaxrscontext", "http://localhost:8080/myapp")
       }

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Javadoc()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `generate()` |
    `FileCollection` | `getClasspath()` | Returns the classpath to use to resolve type references in the source code.
    `File` | `getDestinationDir()` | Returns the directory to generate the documentation into.
    `String` | `getExecutable()` | Returns the Javadoc executable to use to generate the Javadoc.
    `String` | `getMaxMemory()` | Returns the amount of memory allocated to this task.
    `MinimalJavadocOptions` | `getOptions()` | Returns the Javadoc generation options.
    `File` | `getOptionsFile()` |
    `protected File` | `getOutputDirectory()` |
    `FileTree` | `getSource()` | Returns the source for this task, after the include and exclude patterns have been applied.
    `String` | `getTitle()` | Returns the title for the generated documentation.
    `JavaToolChain` | `getToolChain()` | Returns the tool chain that will be used to generate the Javadoc.
    `boolean` | `isFailOnError()` | Specifies whether this task should fail when errors are encountered during Javadoc generation.
    `boolean` | `isVerbose()` | Returns whether Javadoc generation is accompanied by verbose output.
    `void` | `options​(Closure<?> block)` | Convenience method for configuring Javadoc generation options.
    `void` | `options​(Action<? super MinimalJavadocOptions> action)` | Convenience method for configuring Javadoc generation options.
    `void` | `setClasspath​(FileCollection classpath)` | Sets the classpath to use to resolve type references in this source code.
    `void` | `setDestinationDir​(File destinationDir)` | Sets the directory to generate the documentation into.
    `void` | `setExecutable​(String executable)` |
    `void` | `setFailOnError​(boolean failOnError)` |
    `void` | `setMaxMemory​(String maxMemory)` | Sets the amount of memory allocated to this task.
    `void` | `setTitle​(String title)` | Sets the title for the generated documentation.
    `void` | `setToolChain​(JavaToolChain toolChain)` | Sets the tool chain to use to generate the Javadoc.
    `void` | `setVerbose​(boolean verbose)` | Sets whether Javadoc generation is accompanied by verbose output or not.

    - ### Methods inherited from class org.gradle.api.tasks.SourceTask

      `exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, source`

    - ### Methods inherited from class org.gradle.api.internal.ConventionTask

      `conventionMapping, conventionMapping, getConventionMapping`

    - ### Methods inherited from class org.gradle.api.DefaultTask

      `newInputDirectory, newInputFile, newOutputDirectory, newOutputFile`

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `appendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString`

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

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

- - ### Constructor Detail

    - #### Javadoc

          public Javadoc()

  - ### Method Detail

    - #### generate

          protected void generate()

    - #### getSource

          @PathSensitive(RELATIVE)
          public FileTree getSource()

      Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

      The `PathSensitivity` for the sources is configured to be `PathSensitivity.ABSOLUTE`. If your sources are less strict, please change it accordingly by overriding this method in your subclass.

      Overrides:
        `getSource` in class `SourceTask`
      Returns:
        The source.

    - #### getToolChain

          @Inject
          public JavaToolChain getToolChain()

      Returns the tool chain that will be used to generate the Javadoc.

    - #### setToolChain

          public void setToolChain​(JavaToolChain toolChain)

      Sets the tool chain to use to generate the Javadoc.

    - #### getDestinationDir

          @Internal
          @Nullable
          public File getDestinationDir()

      Returns the directory to generate the documentation into.

      Returns:
        The directory.

    - #### getOutputDirectory

          @OutputDirectory
          protected File getOutputDirectory()

    - #### setDestinationDir

          public void setDestinationDir​(File destinationDir)

      Sets the directory to generate the documentation into.

    - #### getMaxMemory

          @Internal
          @Nullable
          public String getMaxMemory()

      Returns the amount of memory allocated to this task.

    - #### setMaxMemory

          public void setMaxMemory​(String maxMemory)

      Sets the amount of memory allocated to this task.
      Parameters:
        `maxMemory` - The amount of memory

    - #### getTitle

          @Nullable
          @Optional
          @Input
          public String getTitle()

      Returns the title for the generated documentation.

      Returns:
        The title, possibly null.

    - #### setTitle

          public void setTitle​(@Nullable
                               String title)

      Sets the title for the generated documentation.

    - #### isVerbose

          @Internal
          public boolean isVerbose()

      Returns whether Javadoc generation is accompanied by verbose output.
      See Also:
        `setVerbose(boolean)`

    - #### setVerbose

          public void setVerbose​(boolean verbose)

      Sets whether Javadoc generation is accompanied by verbose output or not. The verbose output is done via println (by the underlying Ant task). Thus it is not handled by our logging.
      Parameters:
        `verbose` - Whether the output should be verbose.

    - #### getClasspath

          @Classpath
          public FileCollection getClasspath()

      Returns the classpath to use to resolve type references in the source code.
      Returns:
        The classpath.

    - #### setClasspath

          public void setClasspath​(FileCollection classpath)

      Sets the classpath to use to resolve type references in this source code.
      Parameters:
        `classpath` - The classpath. Must not be null.

    - #### getOptions

          public MinimalJavadocOptions getOptions()

      Returns the Javadoc generation options.
      Returns:
        The options. Never returns null.

    - #### options

          public void options​(Closure<?> block)

      Convenience method for configuring Javadoc generation options.
      Parameters:
        `block` - The configuration block for Javadoc generation options.

    - #### options

          public void options​(Action<? super MinimalJavadocOptions> action)

      Convenience method for configuring Javadoc generation options.
      Parameters:
        `action` - The action for Javadoc generation options.
      Since:
        3.5

    - #### isFailOnError

          @Input
          public boolean isFailOnError()

      Specifies whether this task should fail when errors are encountered during Javadoc generation. When `true`, this task will fail on Javadoc error. When `false`, this task will ignore Javadoc errors.

    - #### setFailOnError

          public void setFailOnError​(boolean failOnError)

    - #### getOptionsFile

          @Internal
          public File getOptionsFile()

    - #### getExecutable

          @Nullable
          @Optional
          @Input
          public String getExecutable()

      Returns the Javadoc executable to use to generate the Javadoc. When `null`, the Javadoc executable for the current JVM is used.
      Returns:
        The executable. May be null.

    - #### setExecutable

          public void setExecutable​(@Nullable
                                    String executable)