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

## org.gradle.api.tasks.javadoc
[Java] 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

    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 = file("${reportsDir.absolutePath}/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")
     }

Authors:
  Hans Dockter

Field Summary

Fields inherited from class org.gradle.api.internal.ConventionTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Fields inherited from class DefaultTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Fields inherited from class org.gradle.api.internal.AbstractTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Method Summary
`protected void` | `generate()`
`FileCollection` | `getClasspath()` Returns the classpath to use to resolve type references in the source code.
`java.io.File` | `getDestinationDir()` Returns the directory to generate the documentation into.
`java.lang.String` | `getExecutable()` Returns the javadoc executable to use to generation the javadoc.
`java.lang.String` | `getMaxMemory()` Returns the amount of memory allocated to this task.
`MinimalJavadocOptions` | `getOptions()` Returns the javadoc generation options.
`java.io.File` | `getOptionsFile()`
`java.lang.String` | `getTitle()` Returns the title for the generated documentation.
`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` | `setClasspath(FileCollection classpath)` Sets the classpath to use to resolve type references in this source code.
`void` | `setDestinationDir(java.io.File destinationDir)` Sets the directory to generate the documentation into.
`void` | `setExecutable(java.lang.String executable)`
`void` | `setFailOnError(boolean failOnError)`
`void` | `setMaxMemory(java.lang.String maxMemory)` Sets the amount of memory allocated to this task.
`void` | `setOptions(MinimalJavadocOptions options)` Sets the javadoc generation options.
`void` | `setTitle(java.lang.String title)` Sets the title for the generated documentation.
`void` | `setVerbose(boolean verbose)` Sets whether javadoc generation is accompanied by verbose output or not.

Methods inherited from class SourceTask
exclude, exclude, exclude, exclude, getDefaultSource, getExcludes, getIncludes, getSource, include, include, include, include, setExcludes, setIncludes, setSource, source

Methods inherited from class org.gradle.api.internal.ConventionTask
org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, org.gradle.api.tasks.ConventionValue), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setConventionMapping(org.gradle.api.internal.ConventionMapping), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#captureStandardOutput(org.gradle.api.logging.LogLevel), org.gradle.api.internal.ConventionTask#disableStandardOutputCapture(), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#executeWithoutThrowingTaskFailure(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAdditionalProperties(), org.gradle.api.internal.ConventionTask#getDynamicObjectHelper(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()

Methods inherited from class DefaultTask
setProperty, toString, compareTo, compareTo, getName, getActions, setName, getState, getPath, getLogger, execute, configure, configure, getDescription, isEnabled, captureStandardOutput, disableStandardOutputCapture, property, setEnabled, setDescription, getProject, getGroup, setGroup, dependsOn, getAnt, getConvention, hasProperty, getLogging, getExtensions, executeWithoutThrowingTaskFailure, setActions, getTaskDependencies, getTaskDependencies, getDependsOn, setDependsOn, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, leftShift, deleteAllActions, getEnabled, dependsOnTaskDidWork, getInputs, getOutputs, getOutputs, getTemporaryDir, setProject, getStandardOutputCapture, getAdditionalProperties, getDynamicObjectHelper, getAsDynamicObject, addValidator, getValidators, getExecuter, setExecuter, getOnlyIf, injectIntoNewInstance, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll

Methods inherited from class org.gradle.api.internal.AbstractTask
org.gradle.api.internal.AbstractTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.AbstractTask#toString(), org.gradle.api.internal.AbstractTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.AbstractTask#compareTo(java.lang.Object), org.gradle.api.internal.AbstractTask#getName(), org.gradle.api.internal.AbstractTask#getActions(), org.gradle.api.internal.AbstractTask#setName(java.lang.String), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#getPath(), org.gradle.api.internal.AbstractTask#getLogger(), org.gradle.api.internal.AbstractTask#execute(), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#getDescription(), org.gradle.api.internal.AbstractTask#isEnabled(), org.gradle.api.internal.AbstractTask#captureStandardOutput(org.gradle.api.logging.LogLevel), org.gradle.api.internal.AbstractTask#disableStandardOutputCapture(), org.gradle.api.internal.AbstractTask#property(java.lang.String), org.gradle.api.internal.AbstractTask#setEnabled(boolean), org.gradle.api.internal.AbstractTask#setDescription(java.lang.String), org.gradle.api.internal.AbstractTask#getProject(), org.gradle.api.internal.AbstractTask#getGroup(), org.gradle.api.internal.AbstractTask#setGroup(java.lang.String), org.gradle.api.internal.AbstractTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#getAnt(), org.gradle.api.internal.AbstractTask#getConvention(), org.gradle.api.internal.AbstractTask#hasProperty(java.lang.String), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#getExtensions(), org.gradle.api.internal.AbstractTask#executeWithoutThrowingTaskFailure(), org.gradle.api.internal.AbstractTask#setActions(java.util.List), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getDependsOn(), org.gradle.api.internal.AbstractTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.AbstractTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setDidWork(boolean), org.gradle.api.internal.AbstractTask#getDidWork(), org.gradle.api.internal.AbstractTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doLast(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doLast(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#deleteAllActions(), org.gradle.api.internal.AbstractTask#getEnabled(), org.gradle.api.internal.AbstractTask#dependsOnTaskDidWork(), org.gradle.api.internal.AbstractTask#getInputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getTemporaryDir(), org.gradle.api.internal.AbstractTask#setProject(org.gradle.api.Project), org.gradle.api.internal.AbstractTask#getStandardOutputCapture(), org.gradle.api.internal.AbstractTask#getAdditionalProperties(), org.gradle.api.internal.AbstractTask#getDynamicObjectHelper(), org.gradle.api.internal.AbstractTask#getAsDynamicObject(), org.gradle.api.internal.AbstractTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.AbstractTask#getValidators(), org.gradle.api.internal.AbstractTask#getExecuter(), org.gradle.api.internal.AbstractTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.AbstractTask#getOnlyIf(), org.gradle.api.internal.AbstractTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.AbstractTask#wait(long), org.gradle.api.internal.AbstractTask#wait(long, int), org.gradle.api.internal.AbstractTask#wait(), org.gradle.api.internal.AbstractTask#equals(java.lang.Object), org.gradle.api.internal.AbstractTask#hashCode(), org.gradle.api.internal.AbstractTask#getClass(), org.gradle.api.internal.AbstractTask#notify(), org.gradle.api.internal.AbstractTask#notifyAll()

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Method Detail

### generate

    @TaskAction
    protected void generate()

### getClasspath

    @InputFiles
    public FileCollection getClasspath()

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

### getDestinationDir

    @OutputDirectory
    public java.io.File getDestinationDir()

  Returns the directory to generate the documentation into.

  Returns:
    The directory.

### getExecutable

    @Input
    @Optional
    public java.lang.String getExecutable()

  Returns the javadoc executable to use to generation the javadoc. When `null`, the javadoc executable for the current jvm is used.
  Returns:
    The executable. May be null.

### getMaxMemory

    public java.lang.String getMaxMemory()

  Returns the amount of memory allocated to this task.

### getOptions

    @Nested
    public MinimalJavadocOptions getOptions()

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

### getOptionsFile

    public java.io.File getOptionsFile()

### getTitle

    @Input
    @Optional
    public java.lang.String getTitle()

  Returns the title for the generated documentation.

  Returns:
    The title, possibly null.

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

### isVerbose

    public boolean isVerbose()

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

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

### setDestinationDir

    public void setDestinationDir(java.io.File destinationDir)

  Sets the directory to generate the documentation into.

### setExecutable

    public void setExecutable(java.lang.String executable)

### setFailOnError

    public void setFailOnError(boolean failOnError)

### setMaxMemory

    public void setMaxMemory(java.lang.String maxMemory)

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

### setOptions

    public void setOptions(MinimalJavadocOptions options)

  Sets the javadoc generation options.
  Parameters:
    `options` - The options. Must not be null.

### setTitle

    public void setTitle(java.lang.String title)

  Sets the title for the generated documentation.

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

Groovy Documentation