Hi I'm trying to get cobertura to work, but somehow I cannot seem to figure it out.
I added the most basic config from the docs to the pom.xml. All mvn commands run fine but when running cobertura commands I always get an error saying that a dependency couldnt be resolved:
$ mvn clean cobertura:cobertura
\[ERROR\] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (default-cli) on project openfasttrace-parent: Execution default-cli of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/java-11-openjdk-amd64/../lib/tools.jar -> \[Help 1\]
To make sure its not a peculiarity of my system, I reproduced the error in a Colab Notebook And yes, I did install JDK and not JRE! Compilation and all works absolutely fine. Tried both apt and binary installation. Occurs with every repository I tried. Appreciate any help!
# Install JDK
apt install default-jdk
# Install Maven
wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
tar xvfz apache-maven-3.8.6-bin.tar.gz
# Clone Repo
git clone https://github.com/itsallcode/openfasttrace.git
# Add Cobertura to pom.xml
printf '\n<project xmlns="http://maven.apache.org/POM/4.0.0"\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\n <modelVersion>4.0.0</modelVersion>\n <groupId>org.itsallcode.openfasttrace</groupId>\n <version>0.0.0</version>\n <artifactId>openfasttrace-root</artifactId>\n <name>OpenFastTrace Root Project</name>\n <packaging>pom</packaging>\n <modules>\n <module>parent</module>\n <module>api</module>\n <module>core</module>\n <module>product</module>\n <module>exporter/common</module>\n <module>exporter/markdown</module>\n <module>exporter/specobject</module>\n <module>importer/markdown</module>\n <module>importer/specobject</module>\n <module>importer/tag</module>\n <module>importer/zip</module>\n <module>reporter/plaintext</module>\n <module>reporter/html</module>\n <module>reporter/aspec</module>\n <module>testutil</module>\n </modules>\n <reporting>\n <plugins>\n <plugin>\n <groupId>org.codehaus.mojo</groupId>\n <artifactId>cobertura-maven-plugin</artifactId>\n <version>2.7</version>\n </plugin>\n </plugins>\n </reporting>\n</project>\n' > openfasttrace/pom.xml
# Attempt instrumentation
cd openfasttrace
../apache-maven-3.6.3/bin/mvn clean cobertura:cobertura
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (default-cli) on project openfasttrace-parent: Execution default-cli of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/java-11-openjdk-amd64/../lib/tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Hi I'm trying to get cobertura to work, but somehow I cannot seem to figure it out. I added the most basic config from the docs to the pom.xml. All
mvn
commands run fine but when running cobertura commands I always get an error saying that a dependency couldnt be resolved:To make sure its not a peculiarity of my system, I reproduced the error in a Colab Notebook And yes, I did install JDK and not JRE! Compilation and all works absolutely fine. Tried both apt and binary installation. Occurs with every repository I tried. Appreciate any help!
pom.xml:
Steps to reproduce: