Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8380225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:24:08+00:00 2026-06-09T16:24:08+00:00

After switching from maven 2 to maven 3 I have found out having 0%

  • 0

After switching from maven 2 to maven 3 I have found out having 0% test coverage reported by cobertura. I’ve stated question about which versions of cobertura and surefire to use: What versions of cobertura and surefire plugins work together under maven3?

I have, however, investigated problem deeper and found out what of configuration fragment was not working:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.plugin.version}</version>
            <configuration>
                <forkMode>never</forkMode>
                <redirectTestOutputToFile>true</redirectTestOutputToFile>
                <argLine>-Xmx512m -XX:MaxPermSize=256m</argLine>
            </configuration>
        </plugin>

After changing forkMode from never to once the test coverage started to be generated. So, the problem was not the plugins version incompatibility itself, but the problem with the support by various fork modes of surefire by cobertura under maven 3.

So, my question is, is it a bug, or cobertura plugin is designed in such way, that it won’t work with some forkMode=never?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:24:09+00:00Added an answer on June 9, 2026 at 4:24 pm

    Cobertura is designed to output the coverage results when the JVM exits.

    <forkMode>never</forkMode> instructs Maven not to fork a JVM for running the tests but to re-use the current JVM.

    In this case, the coverage results may not be output until Maven completes execution.

    In Maven 2, I am not 100% certain, but I think some of how the forked lifecycle (evilly) used by the cobertura plugin worked caused either a JVM fork for the forked lifecycle, or else a classloader unload effectively had the same result.

    Thus in my opinion it was a bug of Maven 2 that coverage happened to work with <forkMode>never</forkMode>.

    Note: <forkMode>never</forkMode> is considered quite dangerous because of how System properties are not scoped per classloader, among other issues. <forkMode>once</forkMode> is generally the best option (unless you have tests that abuse memory – some versions of JUnit keep all the test class instances in memory until reporting at the end of the run, so if each test class holds on to heavy objects, GC will be unable to clear them out as they are live until the end of the test run. In such cases a perclass/always forkMode will be required)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After switching from firefox testing to internet explorer testing, some elements couldn't be found
I encountered a problem after switching from server-side JavaScript to CoffeeScript in a Node.js
After a long search I'm still confused about it although I found some related
After switching my Rails 2.3 app from MRI Ruby 1.8.7 to JRuby 1.6.5, the
I am switching from C to C# after 15 years of doing C. I
Switching from Microsofts Oracle Driver to ODP.NET version 10.2.0.100. After changing the data types
I'm experiencing some different behavior after switching from ASP.NET MVC 1.0 to ASP.NET MVC
We are looking at switching from phpundercontrol to Hudson (it looks to have some
I have been searching desperately for an answer to this question, but not found
After switching from 64-bit to 32-bit platform (both of them are CentOS) I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.