# JacocoTaskExtension

API Documentation: | `JacocoTaskExtension`

Extension for tasks that should run with a Jacoco agent to generate coverage execution data.

### Properties

Property | Description
`address` | IP address or hostname to use with `Output.TCP_SERVER` or `Output.TCP_CLIENT`. Defaults to localhost.
`classDumpDir` | Path to dump all class files the agent sees are dumped to. Defaults to no dumps.
`destinationFile` | The path for execution data to be written to.
`dumpOnExit` | Whether or not to dump the coverage data at VM shutdown. Defaults to `true`.
`excludeClassLoaders` | List of classloader names that should be excluded from analysis. Names can use wildcards (* and ?). Defaults to an empty list.
`excludes` | List of class names that should be excluded from analysis. Names can use wildcard (* and ?). Defaults to an empty list.
`includes` | List of class names that should be included in analysis. Names can use wildcards (* and ?). If left empty, all classes will be included. Defaults to an empty list.
`jmx` | Whether or not to expose functionality via JMX under `org.jacoco:type=Runtime`. Defaults to `false`. The configuration of the jmx property is only taken into account if the used JaCoCo version supports this option (JaCoCo version >= 0.6.2)
`output` | The type of output to generate. Defaults to `Output.FILE`.
`port` | Port to bind to for `Output.TCP_SERVER` or `Output.TCP_CLIENT`. Defaults to 6300.
`sessionId` | An identifier for the session written to the execution data. Defaults to an auto-generated identifier.

### Methods

Method | Description
`getAsJvmArg()` | Gets all properties in the format expected of the agent JVM argument.

### Script blocks

No script blocks

### Property details

#### ``Property`<`String`>` `address`

IP address or hostname to use with `Output.TCP_SERVER` or `Output.TCP_CLIENT`. Defaults to localhost.

#### `DirectoryProperty` `classDumpDir`

Path to dump all class files the agent sees are dumped to. Defaults to no dumps.

#### `RegularFileProperty` `destinationFile`

The path for execution data to be written to.

#### ``Property`<`Boolean`>` `dumpOnExit`

Whether or not to dump the coverage data at VM shutdown. Defaults to `true`.

#### ``ListProperty`<`String`>` `excludeClassLoaders`

List of classloader names that should be excluded from analysis. Names can use wildcards (* and ?). Defaults to an empty list.

#### ``ListProperty`<`String`>` `excludes`

List of class names that should be excluded from analysis. Names can use wildcard (* and ?). Defaults to an empty list.

#### ``ListProperty`<`String`>` `includes`

List of class names that should be included in analysis. Names can use wildcards (* and ?). If left empty, all classes will be included. Defaults to an empty list.

#### ``Property`<`Boolean`>` `jmx`

Whether or not to expose functionality via JMX under `org.jacoco:type=Runtime`. Defaults to `false`. The configuration of the jmx property is only taken into account if the used JaCoCo version supports this option (JaCoCo version >= 0.6.2)

#### ``Property`<`Output`>` `output`

The type of output to generate. Defaults to `Output.FILE`.

#### ``Property`<`Integer`>` `port`

Port to bind to for `Output.TCP_SERVER` or `Output.TCP_CLIENT`. Defaults to 6300.

#### ``Property`<`String`>` `sessionId`

An identifier for the session written to the execution data. Defaults to an auto-generated identifier.

### Method details

#### ``Provider`<`String`>` `getAsJvmArg`()

Gets all properties in the format expected of the agent JVM argument.