The JaCoCo Agent Framework causes an application to be automatically configured to work with a bound JaCoCo Service.
| Detection Criterion | Existence of a single bound JaCoCo service.
|
| Tags | jacoco-agent=<version> |
Users may optionally provide their own JaCoCo service. A user-provided JaCoCo service must have a name or tag with jacoco in it so that the JaCoCo Agent Framework will automatically configure the application to work with the service.
The credential payload of the service may contain the following entries:
| Name | Description |
|---|---|
address |
The host for the agent to connect to or listen on. |
destfile |
(Optional) The path to the file where execution data is written. Default is jacoco.exec. |
sessionid |
(Optional) The identifier for the coverage session. Useful for distinguishing between different test runs. |
append |
(Optional) If set to true, coverage data is appended to the existing file. Default is false. |
includes |
(Optional) A list of class names to include in execution analysis. Entries are separated by a colon (:) and may use wildcards (*, ?). |
excludes |
(Optional) A list of class names to exclude from execution analysis. Entries are separated by a colon (:) and may use wildcards (*, ?). |
exclclassloader |
(Optional) A list of class loader names to exclude from instrumentation. Entries are separated by a colon (:). |
inclbootstrapclasses |
(Optional) If set to true, includes bootstrap classes for instrumentation. Default is false. |
inclnolocationclasses |
(Optional) If set to true, includes classes without a location for instrumentation. Default is false. |
dumponexit |
(Optional) If set to true, coverage data is written on JVM shutdown. Default is true. |
output |
(Optional) The mode for the agent. Possible values are tcpclient (default) or tcpserver. |
port |
(Optional) The port for the agent to connect to or listen on. |
classdumpdir |
(Optional) The directory where class files are dumped if class dumping is enabled. |
jmx |
(Optional) If set to true, enables JMX control for the agent. Default is false. |
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to Configuration and Extension.
The framework can be configured by modifying the [config/jacoc_agent.yml][] file in the buildpack fork. The framework uses the Repository utility support and so it supports the version syntax defined there.
| Name | Description |
|---|---|
repository_root |
The URL of the JaCoCo repository index (details). |
version |
The version of JaCoCo to use. Candidate versions can be found in this listing. |
The framework can also be configured by overlaying a set of resources on the default distribution. To do this, add files to the resources/jacoco_agent directory in the buildpack fork. For example, to override the default jacoco.yml add your custom file to resources/jacoco_agent/jacoco.yml.