The docker-maven-plugin and jacoco interferes with each other

476 views Asked by At

We have projects where we use jacoco to aggregate code coverage over several modules. We also have some project that use the Fabric8 docker-maven-plugin to run black box test. But for the first time we would now like to run them both i the same project. And it kind of works but not in the same maven command.

We can run mvn test and then jacoco does it job perfecly. we can run mvn install -Djacoco.skip=true and the black box tests start the necessary docker-containers and run the tests on them.

But running mvn install and thus saying that both blackbox-tests and jacoco codecoverage should run will fail saying that jacoco doesn't find dependencies in a central repository (where they are not supposed to be anyway).

So, my question, what could docker-maven-plugin do to interfere with jacoco? It seems like docker-maven-plugin deletes stuff that jacoco expect to be there.

My configuration for jacoco is using the invoker-plugin (as many of the guides for multi module exampels for jacoco does) with localRepositoryPath, could it be colliding? Or do docker-maven-plugin clean the workspace? Se plugin-definition below.

<plugin>
    <!-- To run with different Maven versions use -Dinvoker.mavenHome -->
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-invoker-plugin</artifactId>
    <version>1.5</version>
    <configuration>
      <skipInvocation>${skipTests}</skipInvocation>
      <projectsDirectory>it</projectsDirectory>
      <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
      <pomIncludes>
        <pomInclude>*/pom.xml</pomInclude>
      </pomIncludes>
      <postBuildHookScript>verify</postBuildHookScript>
      <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
      <goals>
        <goal>clean</goal>
        <goal>install</goal>
      </goals>
      <settingsFile>it/settings.xml</settingsFile>
      <extraArtifacts>
        <extraArtifact>org.jacoco:org.jacoco.agent:0.8.3:jar:runtime</extraArtifact>
      </extraArtifacts>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>install</goal>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
0

There are 0 answers