I'm new to jacoco Please forgive me if I don't articulate this post
correctly.
I'm trying to implement jacoco coverage reports in a multi-project
maven build and I am running into the following error when I run this
command:
mvn -e -s ./settings.xml -am clean package jacoco:check
[ERROR] Failed to execute goal
org.jacoco:jacoco-maven-plugin:0.6.3.201306030806:check (default-cli)
on project utdMaven: Execution default-cli of goal
org.jacoco:jacoco-maven-plugin:0.6.3.201306030806:check failed: Plugin
org.jacoco:jacoco-maven-plugin:0.6.3.201306030806 or one of its
dependencies could not be resolved: The following artifacts could not
be resolved: org.jacoco:org.jacoco.build:jar:0.6.3.201306030806,
org.ow2.asm:asm-all:jar:4.1,
org.apache.maven.reporting:maven-reporting-api:jar:2.1.0,
org.jacoco:org.jacoco.agent:jar:runtime:0.6.3.201306030806: The
repository system is offline but the artifact
org.jacoco:org.jacoco.build:jar:0.6.3.201306030806 is not available in
the local repository. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.jacoco:jacoco-maven-plugin:0.6.3.201306030806:check
(default-cli) on project utdMaven: Execution default-cli of goal
org.jacoco:jacoco-maven-plugin:0.6.3.201306030806:check failed: Plugin
org.jacoco:jacoco-maven-plugin:0.6.3.201306030806 or one of its
dependencies could not be resolved: The following artifacts could not
be resolved: org.jacoco:org.jacoco.build:jar:0.6.3.201306030806,
org.ow2.asm:asm-all:jar:4.1,
org.apache.maven.reporting:maven-reporting-api:jar:2.1.0,
org.jacoco:org.jacoco.agent:jar:runtime:0.6.3.201306030806: The
repository system is offline but the artifact
org.jacoco:org.jacoco.build:jar:0.6.3.201306030806 is not available in
the local repository.
The error seems to be asking me for the
org.jacoco:org.jacoco.build:jar artifact, but I can't seem to find it
anywhere in any maven repository. I have the agent, report, core and
plugin jars.
Below are the specifics of my environment:
Compiling under cygwin
Maven version 3.0.3
jacoco version :0.6.3.201306030806
Java version: jdk1.7.0_09
Parent pom file:
<!-- Begin jacoco -->
<plugin>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>${maven-reporting-impl.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.report</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>${maven-reporting-impl.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.build</artifactId>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.report</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
<configuration>
<destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
<datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- End jacoco -->
Any help appreciated.
Thanks
Steve
Thanks for the response.
I've updated the version of jacoco to 6.4, downloaded core, ant,
plugin, agent, report jars and the build pom file from The Mavin
Central Repository(as pointed to by the jacoco site).
And, changed my settings.xml to use the online repository as
well. Here is what I get:
[INFO] Finished at: Thu Dec 12 15:51:14 EST 2013 [INFO] Final Memory:
16M/220M [INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.jacoco:jacoco-maven-plugin:0.6.4.201312101107:check (default-cli)
on project utdMaven: Execution default-cli of goal
org.jacoco:jacoco-maven-plugin:0.6.4.201312101107:check failed: Plugin
org.jacoco:jacoco-maven-plugin:0.6.4.201312101107 or one of its
dependencies could not be resolved: Could not find artifact
org.jacoco:org.jacoco.build:jar:0.6.4.201312101107 in central
(http://repo1.maven.org/maven2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.jacoco:jacoco-maven-plugin:0.6.4.201312101107:check
(default-cli) on project utdMaven: Execution default-cli of goal
org.jacoco:jacoco-maven-plugin:0.6.4.201312101107:check failed: Plugin
org.jacoco:jacoco-maven-plugin:0.6.4.201312101107 or one of its
dependencies could not be resolved: Could not find artifact
org.jacoco:org.jacoco.build:jar:0.6.4.201312101107 in central
(http://repo1.maven.org/maven2) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
Is there another repository I should point to perhaps?
Steve
I've removed the other entries as you directed and ran with the
following command, once online for dependencies and once offline:
mvn -e -s ./settings_online.xml -pl web/project1,web/project2, web/project3 -am clean package jacoco:report
mvn -e -s ./settings.xml -pl web/project1,web/project2, web/project3 -am clean package jacoco:report
The build ends successfully, but I get the following message and no report:
[INFO] Skipping JaCoCo execution due to missing execution data file
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
Does jacoco build differently under maven using cygwin or linux?
Here is my current pom:
<!-- Begin jacoco -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
<datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- End jacoco -->
Stevem,
do you override argLine in surefire or failsafe? You need to write sth. like <argLine>${argLine} YOUROPTIONSHERE</argLine>, then.
Regards Mirko
--
Sent from my mobile