[JIRA] (JENKINS-54038) Jacoco creates multiple Coverage reports and Trends graphs

2 views
Skip to first unread message

kent@clubsalino.com (JIRA)

unread,
Oct 12, 2018, 3:03:02 AM10/12/18
to jenkinsc...@googlegroups.com
Kent Granström updated an issue
 
Jenkins / Bug JENKINS-54038
Jacoco creates multiple Coverage reports and Trends graphs
Change By: Kent Granström
Summary: Jacoco creates multiple Coverage reports and trends grapphs Trends graphs
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kent@clubsalino.com (JIRA)

unread,
Oct 12, 2018, 6:22:01 AM10/12/18
to jenkinsc...@googlegroups.com
Kent Granström updated an issue
After yesterday's upgrade of Jenkins from 2.140 to 2.146 and several plugins, to many to enumerate, our pipeline jobs now generates loads of jacoco Coverage reports and Trends graphs. The jobs can hardly be opened probably due to the amount of data to load and they take forever to build. What has happened? I'am building at the moment so I'll add relevant data from the log files if I find any suspicous printouts.   

Very similar to this issue:

[http://jenkins-ci.361315.n4.nabble.com/jacoco-plugin-broken-after-update-of-Pipeline-Maven-Integration-plugin-td4948864.html

brainsam@yandex.ru (JIRA)

unread,
Oct 17, 2018, 11:06:03 AM10/17/18
to jenkinsc...@googlegroups.com
Alexander Moiseenko commented on Bug JENKINS-54038
 
Re: Jacoco creates multiple Coverage reports and Trends graphs

We faced the same problem after update from jacoco plugin 3.0.1 to 3.0.3, jenkins core 2.121.1

kent@clubsalino.com (JIRA)

unread,
Oct 18, 2018, 1:50:02 AM10/18/18
to jenkinsc...@googlegroups.com

Can someone who has the knowledge address this issue plz? 

kent@clubsalino.com (JIRA)

unread,
Oct 22, 2018, 3:09:02 AM10/22/18
to jenkinsc...@googlegroups.com
Kent Granström updated an issue
Change By: Kent Granström
Comment:
Can someone who has the knowledge address this issue plz? 

f.modler@gmx.net (JIRA)

unread,
Feb 5, 2019, 6:37:02 AM2/5/19
to jenkinsc...@googlegroups.com
Falko Modler commented on Bug JENKINS-54038
 
Re: Jacoco creates multiple Coverage reports and Trends graphs

As per pipeline-maven 3.5.15+, multi module coverage reports are disabled:

So instead of too many report you get, well, none!

I am not sure how to solve this. I suppose you must now either merge the exec files and feed this into jacoco-plugin explicitly or you have to generate your own report (via the maven plugin) which you then might be able to publish with HTML Publisher Plugin.
Or just use SonarQube...

f.modler@gmx.net (JIRA)

unread,
Feb 5, 2019, 6:37:03 AM2/5/19
to jenkinsc...@googlegroups.com
Falko Modler edited a comment on Bug JENKINS-54038


So instead of too many report you get, well, none!

I am not sure how to solve this. I suppose you must now either merge the exec files and feed this into jacoco-plugin explicitly _or_ you have to generate your own report ([via the maven plugin|https://github.com/jacoco/jacoco/wiki/MavenMultiModule]) which you then _might_ be able to publish with [HTML Publisher Plugin|https://plugins.jenkins.io/htmlpublisher].
Or
" just " use SonarQube...

f.modler@gmx.net (JIRA)

unread,
Feb 5, 2019, 7:25:03 AM2/5/19
to jenkinsc...@googlegroups.com
Falko Modler edited a comment on Bug JENKINS-54038
So instead of too many report reports you get, well, none!


I am not sure how to solve this. I suppose you must now either merge the exec files and feed this into jacoco-plugin explicitly _or_ you have to generate your own report ([via the maven plugin|https://github.com/jacoco/jacoco/wiki/MavenMultiModule]) which you then _might_ be able to publish with [HTML Publisher Plugin|https://plugins.jenkins.io/htmlpublisher].
Or "just" use SonarQube...

f.modler@gmx.net (JIRA)

unread,
Feb 7, 2019, 5:03:01 AM2/7/19
to jenkinsc...@googlegroups.com

Update to my previous comment:

The workaround for recent pipeline-maven versions is actually easier than I first thought:
Just don't rely on withMaven() to create your aggregated report, just add an explicit jacoco() invokation instead!
This will automatically "merge" all the exec files to create one big report for everything.

If you want to explicitly disable the jacoco report publishing via withMaven() (which doesn't work anyway for multiple modules) you have two options:

  • withMaven(publisherStrategy: 'EXPLICIT', options: [...]) (don't add jacocoPublisher() to options)
  • withMaven(options: [jacocoPublisher(disabled: true)],...)

f.modler@gmx.net (JIRA)

unread,
Feb 7, 2019, 5:04:02 AM2/7/19
to jenkinsc...@googlegroups.com
Falko Modler edited a comment on Bug JENKINS-54038
Update to my previous comment:

The *workaround* for recent {{pipeline-maven}} versions is actually easier than I first thought:
Just * don Don 't rely* on {{withMaven()}} to create your aggregated report, just add an explicit {{jacoco()}} invokation instead!

This will automatically "merge" all the {{exec}} files to create one big report for everything.

If you want to _explicitly_ disable the jacoco report publishing via {{withMaven()}} (which doesn't work anyway for multiple modules) you have two options:
- {{withMaven(publisherStrategy: 'EXPLICIT', options: [...])}} (don't add {{jacocoPublisher()}} to options)
- {{withMaven(options: [jacocoPublisher(disabled: true)],...)}}

f.modler@gmx.net (JIRA)

unread,
Feb 7, 2019, 5:04:03 AM2/7/19
to jenkinsc...@googlegroups.com
Falko Modler edited a comment on Bug JENKINS-54038
Update to my previous comment:

The *workaround* for recent {{pipeline-maven}} versions is actually easier than I first thought:
*Don't rely* on {{withMaven()}} to create your aggregated report, just add an explicit {{jacoco()}} invokation invocation instead!

This will automatically "merge" all the {{exec}} files to create one big report for everything.

If you want to _explicitly_ disable the jacoco report publishing via {{withMaven()}} (which doesn't work anyway for multiple modules) you have two options:
- {{withMaven(publisherStrategy: 'EXPLICIT', options: [...])}} (don't add {{jacocoPublisher()}} to options)
- {{withMaven(options: [jacocoPublisher(disabled: true)],...)}}

f.modler@gmx.net (JIRA)

unread,
Feb 7, 2019, 5:09:02 AM2/7/19
to jenkinsc...@googlegroups.com

This ticket should be closed as this is not happening anymore with pipeline-maven 3.5.15+ (see comments above).

cleclerc@cloudbees.com (JIRA)

unread,
Feb 7, 2019, 8:05:02 AM2/7/19
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Feb 7, 2019, 8:07:02 AM2/7/19
to jenkinsc...@googlegroups.com
Cyrille Le Clerc commented on Bug JENKINS-54038
 
Re: Jacoco creates multiple Coverage reports and Trends graphs

Falko Modler can you provide a sample of your fix invoking the `jacoco` step and disabling withMaven - jacoco integration?

f.modler@gmx.net (JIRA)

unread,
Feb 7, 2019, 1:33:02 PM2/7/19
to jenkinsc...@googlegroups.com

A very stripped down excerpt of my setup:

somewhere in your stage
    withMaven(publisherStrategy: 'EXPLICIT') {
        sh "mvn clean install -Pjacoco"
    }
custom 'jacoco' maven profile
        <profile>
            <id>jacoco</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <propertyName>jacoco.agent.argLine</propertyName>
                                </configuration>
                            </execution>
                            <!-- no automatic report here -->
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>${jacoco.agent.argLine} ${surefire.argLine}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
somewhere in your pipeline, e.g. in an 'always' post block
    post {
        always {
            jacoco(exclusionPattern: '**/test*/**/*.class,**/gen/**/*.class',
                   inclusionPattern: 'com/somecompany/someproject/**/*.class,com/somecompany/module/**/*.class')
        }
    }

The patterns are just an example.

f.modler@gmx.net (JIRA)

unread,
Feb 7, 2019, 1:34:04 PM2/7/19
to jenkinsc...@googlegroups.com
Falko Modler edited a comment on Bug JENKINS-54038
A very stripped down excerpt of my setup:

{noformat:title=somewhere in your stage}
    withMaven(publisherStrategy: 'EXPLICIT'
, options: [junitPublisher( ) ]) {

        sh "mvn clean install -Pjacoco"
    }
{noformat}

{code:xml|title=custom 'jacoco' maven profile}
{code}

{noformat:title=somewhere in your pipeline, e.g. in an 'always' post block}

    post {
        always {
            jacoco(exclusionPattern: '**/test*/**/*.class,**/gen/**/*.class',
                   inclusionPattern: 'com/somecompany/someproject/**/*.class,com/somecompany/module/**/*.class')
        }
    }
{noformat}

The patterns are just an example.

dominik.stadler@gmx.at (JIRA)

unread,
Nov 3, 2019, 9:48:03 AM11/3/19
to jenkinsc...@googlegroups.com
centic resolved as Not A Defect
 

As far as I read the comments this was solved elsewhere, so no change necessary in this plugin. Please reopen with some more information if you think otherwise.

Change By: centic
Status: Open Resolved
Resolution: Not A Defect
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages