GithubHelp home page GithubHelp logo

mojohaus / cobertura-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 20.0 3.07 MB

Cobertura Maven Plugin

Home Page: https://www.mojohaus.org/cobertura-maven-plugin/

Java 22.69% Groovy 1.74% CSS 2.20% HTML 70.32% JavaScript 3.05%
java maven maven-plugin mojohaus

cobertura-maven-plugin's People

Contributors

aheritier avatar andham avatar bentmann avatar bimargulies avatar brettporter avatar brianf avatar christ66 avatar davidkarlsen avatar dennisl avatar dependabot[bot] avatar evenisse avatar fgiust avatar hboutemy avatar joakime avatar jvanzyl avatar lennartj avatar mperham avatar olamy avatar rfscholte avatar slachiewicz avatar spyhunter99 avatar struberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cobertura-maven-plugin's Issues

hi,I've got a log4j2 dependency problem

image

I was develop a easy-use springboot project working with log4j2, but it was always give logs about logback and it couldn't generate report successfully.
Hope to make a dig into this, it was annoying.Best regarts.

Arquillian and Cobertura: 0% percent coverage or ClassNotFoundException

Hello everyone, ๐Ÿ˜„

I have a working Arquillian based WildFly test within a Maven build. And now I want to add Cobertura coverage tests.

But it seems it isn't easy: If I just include Cobertura through the Cobertura Maven plugin my build fails because every class has a coverage of 0%, the tests are marked as "Error" (only during the Cobertura test execution, the normal test execution works without any problems) and I get the following error in the console:

java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector
Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.TouchCollector from [Module "deployment.91f93bde-a5de-4cd1-a8e4-d1174885713f.war:main" from Service Module Loader]

And if I add the Cobertura library to the deployment, I get the following error at the end of the complete testing:

Exception in thread "Thread-94" java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/ClassData
    at net.sourceforge.cobertura.coveragedata.ProjectData.getOrCreateClassData(ProjectData.java:88)
    at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:109)
    at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
    at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.ClassData from [Module "deployment.10d71cf1-6f23-46b2-9295-dd93eb249f3f.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    ... 5 more

Then I get a coverage rate. But it is very ugly and the next colleague stumbling across this message will try to fix it.

Is there a way to fix that problem?
I guess it's about the different class loaders and that the inner Cobertura library tries to communicate with the outer Cobertura library. But I have no clue how to solve something like that.

P.S.: I posted a similar request as a thread in the Arquillian forum. I also opened an issue in the Cobertura project.

Link to plugin's web site is reported as redirected by maven linkcheck plugin

Hello!

We use maven linkcheck plugin to check links on checkstyle's website: http://checkstyle.sourceforge.net/ . The plugin reports that on page http://checkstyle.sourceforge.net/plugins.html the following link is redirected:
http://mojo.codehaus.org/cobertura-maven-plugin (302 Found) at http://www.mojohaus.org .

Links on plugins.html are generated by Apache Maven Project Info Reports Plugin. All URLs are grabbed from effective POMs of plugins.

Here is the code:

https://github.com/apache/maven-plugins/blob/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java#L239

https://github.com/apache/maven-plugins/blob/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java#L269

In POM.xml of maven cobertura plugin the problematic link is:
http://mojo.codehaus.org/cobertura-maven-plugin/

As a result, we do not have an ability to change plugins urls on that page, because those links are specified by plugins developers.

So, please correct the link, because there are contradictions between linkcheck and maven cobertura plugin.

Thank in advance!

Cobertura 2.1.1 uses slf4j binding logback-classic

Cobertura 2.1.1 uses the slf4j binding logback-classic, which causes problems when the project has a different slf4j binding:

[INFO] --- cobertura-maven-plugin:2.7:instrument (report:cobertura) @ lightswitch-android ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Saved information on 10 classes.
[INFO] Cobertura: Saved information on 10 classes.

[ERROR] SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/mnt/ssd/m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/mnt/ssd/m2/repository/eu/lp0/slf4j/slf4j-android/1.7.12-0/slf4j-android-1.7.12-0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

This binding should be removed, leaving only slf4j-api.

Please DO NOT propose workarounds, those are in the closed issue #6.

Regression: Cobertura plugin 2.7 breaks multi-project builds

Maven is not supposed to access the local repository in a multi-project build for any artifact creates as part of the reactor run, i.e.

mvn clean package

must succeed even if one of the subprojects is an EAR that contains jar files created earlier in the reactor build. Therefore the reactor collects the artifacts directly from the target directories. The Cobertura plugin replaces since version 2.7 the jar file in target with the instrumented version with the bad side-effect that the instrumented version is collected and inserted in an EAR (or WAR or ...) that depends on it and is also part of the multi-project. This happens for

mvn clean package site

And it gets worse in combination with the release plugin which will normally executes

mvn clean deploy site

In this case the created and deployed jar file is proper, the Cobertura plugin will then replace the jar file in target with the instrumented version for the report - with the consequence that the EAR created and deployed later in the reactor build suddenly contains the instrumented classes and your released EAR fails to deploy in the application server because of missing classes of the Cobertura runtime.

ProGuard fails while generating site.

I configured ProGuard and it works when packaging..

$ mvn clean package

When I tries to generate site, I got,

can't find referenced class net.sourceforge.cobertura.coveragedata.LightClassmapListener

It seems that cobertural changes classes while instrumenting. I'm not sure this problem is related to https://github.com/cobertura/cobertura.

cobertura:clean doesn't actually do anything at all

As title says. This prevents testing and building release artifacts in one mvn execution, because the classes in generated-classes will overwrite the non-instrumented classes during jar creation. This goal should be deleting generated-classes/cobertura.

Plugin complains about "INVOKESPECIAL/STATIC on interfaces require ASM 5" although ASM 5.0.1 present

In the build I do the get following output:

[WARN] Unable to instrument file XXX/MyClass.class
java.lang.IllegalArgumentException: INVOKESPECIAL/STATIC on interfaces require ASM 5
    at org.objectweb.asm.MethodVisitor.visitMethodInsn(Unknown Source) ~[asm-5.0.1.jar:5.0.1]
    at org.objectweb.asm.ClassReader.a(Unknown Source) ~[asm-5.0.1.jar:5.0.1]
    at org.objectweb.asm.ClassReader.b(Unknown Source) ~[asm-5.0.1.jar:5.0.1]
    at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-5.0.1.jar:5.0.1]
    at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-5.0.1.jar:5.0.1]
    at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:161) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:129) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:243) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentationToSingleClass(CodeInstrumentationTask.java:299) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:308) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.instrument(CodeInstrumentationTask.java:90) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.dsl.Cobertura.instrumentCode(Cobertura.java:74) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.InstrumentMain.instrument(InstrumentMain.java:82) [cobertura-2.1.1.jar:2.1.1]
    at net.sourceforge.cobertura.instrument.InstrumentMain.main(InstrumentMain.java:99) [cobertura-2.1.1.jar:2.1.1]

So from the stack trace it seems that ASM 5.0.1 is present. Still it complains that ASM 5 is missing.

cobertura-maven-plugin does not support Java 1.8 properly

Hello!

I have the following class which uses stream feature from Java 1.8:

import java.util.Arrays;

public class Main {
    public static boolean containsEvenNumbers(int... array) {
        return Arrays.stream(array).anyMatch(number -> isEven(number));
    }

    private static boolean isEven(int number) {
        return number % 2 == 0;
    }

}

I also wrote UT for the class:

import static org.junit.Assert.assertTrue;
import org.junit.Test;

public class MainTest {
    @Test
    public void testContainsEvenNumbers() {
        final int[] array = {1, 2, 3, 4, 5, 6, 7};
        assertTrue(Main.containsEvenNumbers(array));
    }
}

My pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>test</groupId>
    <artifactId>com-test</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <check>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

When I try to execute the following command:

mvn clean cobertura:cobertura

Cobertura crashes. Stack trace:

[ERROR] net.sourceforge.cobertura.javancss.parser.ParseException: Encountered " ">" "> "" at line 6, column 54.
Was expecting one of:
    "assert" ...
    "boolean" ...
    "byte" ...
    "char" ...
    "double" ...
    "enum" ...
    "false" ...
    "float" ...
    "int" ...
    "long" ...
    "new" ...
    "null" ...
    "short" ...
    "super" ...
    "this" ...
    "true" ...
    "void" ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <CHARACTER_LITERAL> ...
    <STRING_LITERAL> ...
    <IDENTIFIER> ...
    "(" ...
    "!" ...
    "~" ...
    "++" ...
    "--" ...
    "+" ...
    "-" ...

        at net.sourceforge.cobertura.javancss.parser.JavaParser.generateParseException(JavaParser.java:10490)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.jj_consume_token(JavaParser.java:10366)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.UnaryExpression(JavaParser.java:3175)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.MultiplicativeExpression(JavaParser.java:3090)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.AdditiveExpression(JavaParser.java:3085)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ShiftExpression(JavaParser.java:3027)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.RelationalExpression(JavaParser.java:2990)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.InstanceOfExpression(JavaParser.java:2977)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.AssigmentExpression(JavaParser.java:2959)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.EqualityExpression(JavaParser.java:2886)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.AndExpression(JavaParser.java:2860)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ExclusiveOrExpression(JavaParser.java:2843)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.InclusiveOrExpression(JavaParser.java:2826)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ConditionalAndExpression(JavaParser.java:2808)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ConditionalOrExpression(JavaParser.java:2790)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ConditionalExpression(JavaParser.java:2774)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.Expression(JavaParser.java:2718)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ArgumentList(JavaParser.java:3620)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.Arguments(JavaParser.java:3610)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.PrimarySuffix(JavaParser.java:3511)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.PrimaryExpression(JavaParser.java:3384)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.PostfixExpression(JavaParser.java:3330)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.UnaryExpressionNotPlusMinus(JavaParser.java:3237)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.UnaryExpression(JavaParser.java:3171)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.MultiplicativeExpression(JavaParser.java:3090)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.AdditiveExpression(JavaParser.java:3061)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ShiftExpression(JavaParser.java:3027)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.RelationalExpression(JavaParser.java:2990)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.InstanceOfExpression(JavaParser.java:2977)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.AssigmentExpression(JavaParser.java:2959)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.EqualityExpression(JavaParser.java:2886)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.AndExpression(JavaParser.java:2860)

The full stacktrace.txt.

Nevertheless, Cobertura works fine if it is run with the following command:

mvn clean cobertura:check

It should be @threadSafe

The plugin should be @threadsafe.

15:01:50 [WARNING] *****************************************************************
15:01:50 [WARNING] * Your build is requesting parallel execution, but project *
15:01:50 [WARNING] * contains the following plugin(s) that are not marked as *
15:01:50 [WARNING] * @threadsafe to support parallel building. *
15:01:50 [WARNING] * While this /may/ work fine, please look for plugin updates *
15:01:50 [WARNING] * and/or request plugins be made thread-safe. *
15:01:50 [WARNING] * If reporting an issue, report it against the plugin in *
15:01:50 [WARNING] * question, not against maven-core *
15:01:50 [WARNING] *****************************************************************
15:01:50 [WARNING] The following plugins are not marked @threadsafe in MODULE-NAME:
15:01:50 [WARNING] org.codehaus.mojo:cobertura-maven-plugin:2.7

aggregating multi module results does not aggregate inside a package

While newly touched packages are aggregated fine to the result in jenkins, coverage information of already registered classes are not aggregated.
Thus classes in one submodule highly covered in another submodule's test are shown as poorly or not at all covered.
Is that intentional following the idea โ€œunit tests should be in the same module as the tested classโ€?
is there an option to consider all covered classes?

Source and Test code in separate modules does not work

My Parent Pom file has modules listed as

<modules>
    <module>myProject</module>
    <module>TypeAbTests</module>
    <module>TypeCdTests</module>
</modules>

Where all the source code is present in module myProject and all tests in the other 2 modules.

The result is always 0% code coverage

CoberturaInstrumentMojo doesn't use maxmem setting

The configuration used for instrumentation creates a new ConfigInstrumentation but doesn't call setMaxmem() on it, so the default 64m applies.

If this is not enough memory for the instrumentation phase then the report generation will fail.

The only way to provide a maxmem setting is via the MAVEN_OPTS environment variable, but it should be possible to do this using the cobertura.maxmem property.

Cobertura does not include results in test-coverage

Hi to all, I use maven plugin Cobertura 2.7. I want to test the below method.

protected void validateCategoryAndAssociatedQuestionType(CategoryQuestionDto dto, Category cat, Question que) {
		
if (!((cat instanceof TriviaCategory && que instanceof TriviaQuestion) || (cat instanceof TestCategory && que instanceof TestQuestion) || (cat instanceof GuessingGameCategory && que instanceof GuessingGameQuestion))) 
{
			
throw new QuestionAndCategoryNotOfTheSameTypeException("Question with id: " + dto.getId().getQuestionId() + " and Category with id: " + dto.getId().getCategoryId() + " are not of the same type");

}
}

and I am testing this with the below test.

@Test(expected = QuestionAndCategoryNotOfTheSameTypeException.class)
	
public void validateCategoryAndAssociatedQuestionTypeFailure6(){
		
                GuessingGameCategory category = new GuessingGameCategory();
		TestQuestion question = new TestQuestion();
		
                question.setId(1);
	        category.setId(1);

		CategoryQuestion pair = new CategoryQuestion(category, question, (short)1);
		service.validateCategoryAndAssociatedQuestionType(new  CategoryQuestionDto().fromEntity(pair), category, question);
	}
``` 

Can someone tell me why this method in coverage report is with red lines?

"quiet" option suppresses error messages

Documentation for the "quiet" optional parameter says:

Only output Cobertura errors, avoid info messages.

But I noticed that running the check goal with quiet=true also suppresses error-level messages:

with quiet=false

[INFO] <<< cobertura-maven-plugin:2.7:check (default) < [cobertura]test @ project <<<
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:check (default) @ project ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Loaded information on 10 classes.
[ERROR] project failed coverage check. Branch coverage rate of 69.1% is below 99.0%
[ERROR] project failed coverage check. Line coverage rate of 89.2% is below 99.0%

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

with quiet=true

[INFO] <<< cobertura-maven-plugin:2.7:check (default) < [cobertura]test @ project <<<
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:check (default) @ project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

I would expect to see the two ERROR lines when quiet=true.

Feature: Ability to generate reports as part of regular build (not site)

I've have been using Cobertura via maven site goal for very long time and maven-site-plugin is nothing but trouble. Our project are large with many different dependencies, with many jar including different version of libraries like Guava, etc.

The maven-site-plugin seems to load plugins and dependencies into class path differently, which causes all kinds of random build failures while doing static code analysis. The normal build (mvn clean install) will pass, but mvn site will fail.

For this reason I really wanted to be able to wire cobertura into normal build life cycle. Turns out that we can already wire the instrument goal, but not the report generation (cobertura.ser --> cobertura.xml) that can be consumed by the Jenkins plugin. Adding new generate-report goal allowed me to wire Cobertura directly into build (mvn clean install).

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>cobertura-maven-plugin</artifactId>
    <version>${coberturaPlugin.version}</version>
    <executions>
        <execution>
            <id>cobertura-clean</id>
            <goals>
                <goal>clean</goal>
            </goals>
        </execution>
        <execution>
            <id>cobertura-instrument-code</id>
            <phase>process-classes</phase>
            <goals>
                <goal>instrument</goal>
            </goals>
        </execution>
        <execution>
            <id>cobertura-generate-report</id>
            <phase>verify</phase>
            <goals>
                <goal>generate-report</goal>
            </goals>
        </execution>
    </executions>
</plugin>

I added this new generate-report a while back and it has been working rather good. There was some projects with our custom OSGI plugins that I had to exclude because I couldn't figure out what is the problem. Also because Cobertura actually modified the target class path in the maven environment I had to also add this 'hack' to maven-bundle-plugin.

image

Cobertura Maven Plugin doesn't check regex parameters

Hello everyone, ๐Ÿ˜„

last week I came across the following problem: I had a few classes in which I couldn't get the needed / defined branch coverage rate. So I tried to use the element in the configuration of the plugin. As only the branch coverage rate was the problem I also defined only this parameter. So it looked something like this:

                <configuration>
                    <check>
                        <regexes>
                            <regex>
                                <pattern>my.package.MyClass</pattern>
                                <branchRate>61</branchRate>
                            </regex>
                        </regexes>
                    </check>
                </configuration>

I started my Maven build and got a very odd error from Cobertura (not the plugin) that a value couldn't be parsed. After some searching and debugging I found the problem: The parameter was missing. And if that functionality is used both parameters - and are mandatory for Cobertura. But the Cobertura Maven Plugin doesn't validate that.

It would have been much easier if the plugin would have failed with an error message which pointed this out.

cobertura-maven-plugin does not build with JDK 9-EA

When I try to build the plugin with the JDK 9 I the following error message:

[ERROR] Failed to execute goal on project cobertura-maven-plugin: Could not resolve dependencies for project org.codehaus.mojo:cobertura-maven-plugin:maven-plugin:2.8-SNAPSHOT: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/java-9-jdk/../lib/tools.jar -> [Help 1]

Cobertura plugin seems to fail when attempting to run both check and cobertura in test phase

This is the error I get when I attempt to run both check and cobertura in test phase. It's also not clear if cobertura can run in verify phase skipping tests on it's own since that also fails.

In the end what I'm looking for is working configuration (in a POM file) that would run check and give reporting. This plugin does not seem able to do both as far as I can tell.

e.g. execution:

 <executions>
                        <execution>
                            <id>default-cobertura</id>
                            <phase>test</phase>
                            <goals>
                                <goal>cobertura</goal>
                                <goal>check</goal>
                            </goals>
                        </execution>
 </executions>
[INFO] --- cobertura-maven-plugin:2.7:instrument (default-cobertura) @ project-id ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:45 min
[INFO] Finished at: 2015-10-06T17:41:41-04:00
[INFO] Final Memory: 40M/1963M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "master" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (default-cobertura) on project doc-core: Unable to prepare instrumentation directory. source and destination are the same directory. -> [Help 1]

Cobertura breaks build because of tag "consolePlugin" in logback.xml

A Jenkins job for my application failed (the process didn't end) when configuring cobertura-maven-plugin for code coverage. When I started analyzing the problem I found that the tag "consolePlugin" in my logback.xml caused the problem. With the tag the build fails, without it works fine.
I can't imagine what leads to this error with cobertura. Will there be a bugfix in cobertura-maven-plugin?

Cobertura: Error reading file cobertura.ser: null java.io.EOFException: null

We are running maven plugin in side jenkins and we are getting the following error. Can you provide me with any ideas to correct this issue. Thanks in Advance

10:01:44 [INFO] --- cobertura-maven-plugin:2.7:cobertura (default-cli) @ cips-core ---
10:01:44 [INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
10:01:44 [ERROR] Cobertura: Error reading file C:\jenkins\slaves\at-deployer\workspace\ICD-t__cips-parent__code-coverage-git\cips-parent\cips-core\target\cobertura\cobertura.ser: null
10:01:44 java.io.EOFException: null
10:01:44 at java.io.ObjectInputStream$BlockDataInputStream.readFully(ObjectInputStream.java:2744) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1979) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_51]
10:01:44 at java.util.HashMap.readObject(HashMap.java:1184) ~[na:1.7.0_51]
10:01:44 at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[na:na]
10:01:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
10:01:44 at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:500) ~[na:1.7.0_51]
10:01:44 at net.sourceforge.cobertura.coveragedata.CoverageDataContainer.readObject(CoverageDataContainer.java:321) ~[cobertura-2.1.1.jar:2.1.1]
10:01:44 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) ~[na:na]
10:01:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
10:01:44 at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_51]
10:01:44 at java.util.HashMap.readObject(HashMap.java:1184) ~[na:1.7.0_51]
10:01:44 at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[na:na]
10:01:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
10:01:44 at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:500) ~[na:1.7.0_51]
10:01:44 at net.sourceforge.cobertura.coveragedata.CoverageDataContainer.readObject(CoverageDataContainer.java:321) ~[cobertura-2.1.1.jar:2.1.1]
10:01:44 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
10:01:44 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_51]
10:01:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
10:01:44 at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_51]
10:01:44 at java.util.HashMap.readObject(HashMap.java:1184) ~[na:1.7.0_51]
10:01:44 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
10:01:44 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_51]
10:01:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
10:01:44 at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:500) ~[na:1.7.0_51]
10:01:44 at net.sourceforge.cobertura.coveragedata.CoverageDataContainer.readObject(CoverageDataContainer.java:321) ~[cobertura-2.1.1.jar:2.1.1]
10:01:44 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
10:01:44 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_51]
10:01:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
10:01:44 at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_51]
10:01:44 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_51]
10:01:44 at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.loadCoverageData(CoverageDataFileHandler.java:85) ~[cobertura-2.1.1.jar:2.1.1]
10:01:44 at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.loadCoverageData(CoverageDataFileHandler.java:62) ~[cobertura-2.1.1.jar:2.1.1]
10:01:44 at net.sourceforge.cobertura.dsl.Cobertura.getProjectDataInstance(Cobertura.java:146) [cobertura-2.1.1.jar:2.1.1]
10:01:44 at net.sourceforge.cobertura.dsl.Cobertura.report(Cobertura.java:122) [cobertura-2.1.1.jar:2.1.1]
10:01:44 at net.sourceforge.cobertura.reporting.ReportMain.parseArgumentsAndReport(ReportMain.java:91) [cobertura-2.1.1.jar:2.1.1]
10:01:44 at net.sourceforge.cobertura.reporting.ReportMain.generateReport(ReportMain.java:141) [cobertura-2.1.1.jar:2.1.1]
10:01:44 at net.sourceforge.cobertura.reporting.ReportMain.main(ReportMain.java:151) [cobertura-2.1.1.jar:2.1.1]

Cobertura-plugin 2.7 modifies the build's log4j configuration

Hi. I don't know whether this issue is related to #6 or not.
However, I have Maven modules that depend on libraries using SLF4j. And when I run mvn clean cobertura:cobertura on these modules, I see a lot of DEBUG outputs. Most of them are related to my dependencies. But, it seems Cobertura's LOG4j configuration overrides my global configuration.

So, said differently, when using the Cobertura plug-in in version 2.7 with my project, some modules display DEBUG logs they should not. The quiet property does not change anything. Swicthing back to the Cobertura plug-in 2.6 solves the issue (debug messages are not shown anymore).

Cobertura does not include into coverage report classes which have interface import from java.util.stream

Based on #21 (comment) and #18

Main.java

import java.util.stream.Stream;
public class Main {
    public static void main(String[] args) {
        Stream.of("a", "b");
    }
}

MainTest.java

import org.junit.Test;

public class MainTest {
    @Test
    public void testMain() {
    }
}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
</dependencies>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
</project>

CMD: mvn clean cobertura:cobertura
Expected result: class Main is included into coverage report (0% coverage)
Actual result: class Main is not included into coverage report (report is empty)

cobertura-maven-plugin doesn't bring up the true coverage of classes.

The plugin does not show the coverage of the java class for which test cases are written to cover all the flows in the code. Coverage for the same class in Eclipse EclEmma is shown as 90% where as it is shown as 1% in cobertura index.html generated using the plugin. Code coverage is not shown for integration tests also.

Could not find artifact com.sun:tools:jar:0

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!

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.itsallcode.openfasttrace</groupId>
    <version>0.0.0</version>
    <artifactId>openfasttrace-root</artifactId>
    <name>OpenFastTrace Root Project</name>
    <packaging>pom</packaging>
    <modules>
        <module>parent</module>
        <module>api</module>
        <module>core</module>
        <module>product</module>
        <module>exporter/common</module>
        <module>exporter/markdown</module>
        <module>exporter/specobject</module>
        <module>importer/markdown</module>
        <module>importer/specobject</module>
        <module>importer/tag</module>
        <module>importer/zip</module>
        <module>reporter/plaintext</module>
        <module>reporter/html</module>
        <module>reporter/aspec</module>
        <module>testutil</module>
    </modules>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
            </plugin>
        </plugins>
    </reporting>
</project>

Steps to reproduce:

# 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

Cobertura 2.1.1 uses slf4j binding logback-classic

Cobertura 2.1.1 uses the slf4j binding logback-classic, which causes problems when the project has a different slf4j binding:

[INFO] --- cobertura-maven-plugin:2.7:instrument (report:cobertura) @ lightswitch-android ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Saved information on 10 classes.
[INFO] Cobertura: Saved information on 10 classes.

[ERROR] SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/mnt/ssd/m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/mnt/ssd/m2/repository/eu/lp0/slf4j/slf4j-android/1.7.12-0/slf4j-android-1.7.12-0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

Cobertura Maven Plugin - Multi Project Build Cobertura.ser issue

When there are modules have local dependencies on other modules, cobertura (using 2.7) generates two cobertura.ser files, one is in target/cobertura/cobertura.ser, the other is $(basedir)/cobertura.ser, and the coverage is always 0 for those modules have local dependencies, is it something that can be fixed ? for modules that do not have dependencies, it works fine.

using corbertura-integration-test fails on multi module build with NoClassDefFoundError

I have a multi-module build with submodule A and B. B depends on classes from A.
Both modules have unit and integration-tests.

Configuring the cobertura-integration-test-goal for verify leads to failing tests with java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector.
Using cobertura-goal everything is fine.

I seems the "ordinary" surefire-test-execution in submodule B picks up instrumented classes from a and is missing cobertura on the classpath.

Sample project to reproduce:
https://github.com/joshiste/cobertura-mm-issue

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] cobertura-issue
[INFO] cobertura-issue-a
[INFO] cobertura-issue-b
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cobertura-issue 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cobertura-issue ---
[INFO] Deleting /home/johannes/projects/cobertura-mm-issue/target
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:integration-test (default) @ cobertura-issue ---
[INFO] No tests to run.
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:verify (default) @ cobertura-issue ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] >>> cobertura-maven-plugin:2.7:cobertura-integration-test (default) > [cobertura]verify @ cobertura-issue >>>
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:instrument (default) @ cobertura-issue ---
[INFO] Skipping cobertura mojo for project with packaging type 'pom'
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:integration-test (default) @ cobertura-issue ---
[INFO] No tests to run.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:verify (default) @ cobertura-issue ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] <<< cobertura-maven-plugin:2.7:cobertura-integration-test (default) < [cobertura]verify @ cobertura-issue <<<
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:cobertura-integration-test (default) @ cobertura-issue ---
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cobertura-issue-a 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cobertura-issue-a ---
[INFO] Deleting /home/johannes/projects/cobertura-mm-issue/a/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cobertura-issue-a ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/johannes/projects/cobertura-mm-issue/a/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ cobertura-issue-a ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/johannes/projects/cobertura-mm-issue/a/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cobertura-issue-a ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/johannes/projects/cobertura-mm-issue/a/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ cobertura-issue-a ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/johannes/projects/cobertura-mm-issue/a/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.19:test (default-test) @ cobertura-issue-a ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.joshiste.cobertura.ATest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in com.joshiste.cobertura.ATest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ cobertura-issue-a ---
[INFO] Building jar: /home/johannes/projects/cobertura-mm-issue/a/target/cobertura-issue-a-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:integration-test (default) @ cobertura-issue-a ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.joshiste.cobertura.AITest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec - in com.joshiste.cobertura.AITest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:verify (default) @ cobertura-issue-a ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] >>> cobertura-maven-plugin:2.7:cobertura-integration-test (default) > [cobertura]verify @ cobertura-issue-a >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cobertura-issue-a ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/johannes/projects/cobertura-mm-issue/a/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ cobertura-issue-a ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:instrument (default) @ cobertura-issue-a ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Saved information on 1 classes.
[INFO] Cobertura: Saved information on 1 classes.

[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cobertura-issue-a ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/johannes/projects/cobertura-mm-issue/a/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ cobertura-issue-a ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.19:test (default-test) @ cobertura-issue-a ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.joshiste.cobertura.ATest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.252 sec - in com.joshiste.cobertura.ATest
[INFO] Cobertura: Loaded information on 1 classes.
[INFO] Cobertura: Saved information on 1 classes.

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ cobertura-issue-a ---
[INFO] Building jar: /home/johannes/projects/cobertura-mm-issue/a/target/cobertura-issue-a-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:integration-test (default) @ cobertura-issue-a ---
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19:verify (default) @ cobertura-issue-a ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] <<< cobertura-maven-plugin:2.7:cobertura-integration-test (default) < [cobertura]verify @ cobertura-issue-a <<<
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:cobertura-integration-test (default) @ cobertura-issue-a ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Loaded information on 1 classes.
Report time: 76ms

[INFO] Cobertura Report generation was successful.
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cobertura-issue-b 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cobertura-issue-b ---
[INFO] Deleting /home/johannes/projects/cobertura-mm-issue/b/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cobertura-issue-b ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/johannes/projects/cobertura-mm-issue/b/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ cobertura-issue-b ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/johannes/projects/cobertura-mm-issue/b/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cobertura-issue-b ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/johannes/projects/cobertura-mm-issue/b/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ cobertura-issue-b ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/johannes/projects/cobertura-mm-issue/b/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.19:test (default-test) @ cobertura-issue-b ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.joshiste.cobertura.BTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE! - in com.joshiste.cobertura.BTest
hello(com.joshiste.cobertura.BTest)  Time elapsed: 0.004 sec  <<< ERROR!
java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector
    at com.joshiste.cobertura.BTest.hello(BTest.java:11)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.TouchCollector
    at com.joshiste.cobertura.BTest.hello(BTest.java:11)


Results :

Tests in error: 
  BTest.hello:11 ยป NoClassDefFound net/sourceforge/cobertura/coveragedata/TouchC...

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] cobertura-issue .................................... SUCCESS [  1.126 s]
[INFO] cobertura-issue-a .................................. SUCCESS [  5.839 s]
[INFO] cobertura-issue-b .................................. FAILURE [  0.664 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.737 s
[INFO] Finished at: 2015-10-29T22:34:40+01:00
[INFO] Final Memory: 22M/257M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project cobertura-issue-b: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/johannes/projects/cobertura-mm-issue/b/target/surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cobertura-issue-b

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.