# Gradle plugins integration tests code coverage with Jacoco plugin

**URL:** <https://discuss.gradle.org/t/gradle-plugins-integration-tests-code-coverage-with-jacoco-plugin/12403>\
**Category:** Help/Discuss\
**Created:** [October 23, 2015, 5:46pm UTC](https://discuss.gradle.org/t/gradle-plugins-integration-tests-code-coverage-with-jacoco-plugin/12403 "2015-10-23T17:46:59Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![iwarapter](https://avatars.discourse-cdn.com/v4/letter/i/ccd318/32.png) [@iwarapter](https://discuss.gradle.org/u/iwarapter)\
**Post date:** [July 10, 2016, 9:53am UTC](https://discuss.gradle.org/t/gradle-plugins-integration-tests-code-coverage-with-jacoco-plugin/12403/7 "2016-07-10T09:53:13Z")

</div>

I did get this to work, to ensure i always had the correct jacoco runtime available i added a configuration with the dependency and then wrote the correct org.gradle.jvmargs to the gradle.properties file before then running the build:

> ./gradlew setupJacocoProps  
> ./gradlew integTest

etc

> configurations {  
> jacocoRuntime  
> }

> dependencies {  
> jacocoRuntime “org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime”  
> }

> task setupJacocoProps \<\< {  
> file(‘gradle.properties’).write(“org.gradle.jvmargs:-javaagent:${configurations.jacocoRuntime.asPath}=destfile=$buildDir/jacoco/testKit.exec”)  
> }

Hope this helps.

---

_[View the full topic](https://discuss.gradle.org/t/gradle-plugins-integration-tests-code-coverage-with-jacoco-plugin/12403)._
