# Cannot run code coverage

**URL:** <https://community.developer.atlassian.com/t/cannot-run-code-coverage/22393>\
**Category:** Atlassian Developer Tools\
**Tags:** plugin-sdk, bitbucket-server, clover\
**Created:** [August 15, 2018, 4:02pm UTC](https://community.developer.atlassian.com/t/cannot-run-code-coverage/22393 "2018-08-15T16:02:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan.selin](https://avatars.discourse-cdn.com/v4/letter/i/b2d939/32.png) [@ivan.selin](https://community.developer.atlassian.com/u/ivan.selin)\
**Post date:** [August 15, 2018, 4:02pm UTC](https://community.developer.atlassian.com/t/cannot-run-code-coverage/22393/1 "2018-08-15T16:02:38Z")

</div>

I’m trying to get the test coverage of my plugin. Documentation clearly states that I should use command `atlas-clover` for that. But unfortunately it does not work at all.

`atlas-clover` runs old version of clover (3.1.7), which does not support java 8. I’ve figured that there is a new version of clover available and ran it manually the way that `atlas-clover` does:  
`$ /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1/bin/mvn -Djava.awt.headless=true com.atlassian.maven.plugins:clover-maven-plugin:4.1.2:setup verify com.atlassian.maven.plugins:clover-maven-plugin:4.1.2:clover com.atlassian.maven.plugins:clover-maven-plugin:4.1.2:log -gs /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1/conf/settings.xml -Dmaven.clover.jdk=1.8`

It clover’s my plugin classes correctly, compiles everything, runs unit tests - everything good so far. But then it runs integration tests, and that fails. During installation of main plugin, it fails to import Spring components related to clover. There is a file `target/testlibs/provided/clover-4.1.2.jar`, so clover exists, but just fails to import. Error is like this:

```auto
[INFO] 2018-08-04 19:30:06,985 WARN [spring-startup] c.a.plugin.impl.AbstractPlugin Unable to enable plugin 'com.example.check_coverage'
...
[INFO] Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.example.check_coverage [129]: Unable to resolve 129.0: missing requirement [129.0] osgi.wiring.package; (osgi.wiring.package=com_atlassian_clover)

```

I’ve tried adding explicit spring component imports to pom.xml and/or adding clover as a dependency to the base plugin, but nothing works.

Linux, Ubuntu 18.04, reproduces on a fresh plugin (after `atlas-create-bitbucket-plugin`).

Output of `atlas-version`:

```auto
ATLAS Version: 6.3.10
ATLAS Home: /usr/share/atlassian-plugin-sdk-6.3.10
ATLAS Scripts: /usr/share/atlassian-plugin-sdk-6.3.10/bin
ATLAS Maven Home: /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1
AMPS Version: 6.3.15
--------
Executing: /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1/bin/mvn --version -gs /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1/conf/settings.xml
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T21:37:52+03:00)
Maven home: /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-29-generic", arch: "amd64", family: "unix"

```
