Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14552

Cannot plublish cobertura reports if org.codehaus.mojo:cobertura-maven-plugin is not invoked

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cobertura-plugin
    • None
    • Jenkins cobertura plugin 1.4, 1.5
      grails and grails maven plugin

      I'm building a project using grails and grails-maven-plugin.
      Since version 1.4 of the plugin, the cobertura report is not published because the cobertura-maven-plugin is not invoked:

      ...
      Cobertura: Loaded information on 293 classes.
      Cobertura: Saved information on 293 classes.
      Skipping Cobertura coverage report as mojo did not run.
      ...
      

      Looking at the sources of the plugin, it's mandatory to execute the cobertura-maven-plugin to publish reports (and that's not the way grails work!).

      I can't see why this test is done (as we need to provide the path of the report). Would it be possible to remove/adapt this check?

      As a workaround: I'm using version 1.3 of the plugin.

      thanks

          [JENKINS-14552] Cannot plublish cobertura reports if org.codehaus.mojo:cobertura-maven-plugin is not invoked

          Miguel Almeida added a comment - - edited

          I don't know what the OP meant with "the cobertura-maven-plugin is not invoked:". However, in 1.5 the plugin is not producing the reports for a multi-module maven project of mine.

          Details:

          • Multi-module project
          • Maven project
          • Goal: install
          • Post-steps: cobertura:cobertura

          Result:

          • No coverage report produced (xml is in the workspace) [1]

          Same setup, plugin version 1.3:

          • Coverage report produced correctly [2]

          [1]
          [INFO] Cobertura Report generation was successful.
          [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
          Cobertura: Loaded information on 53 classes.
          Report time: 1670ms

          [INFO] Cobertura Report generation was successful.
          [INFO] ------------------------------------------------------------------------
          [INFO] Reactor Summary:
          [INFO]
          [INFO] Parent .............................................. SUCCESS [2.882s]
          [INFO] Model .............................................. SUCCESS [5.370s]
          [INFO] Web ................................................. SUCCESS [33.970s]
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESS
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 2:40.478s
          [INFO] Finished at: Wed Jul 25 13:08:43 WEST 2012
          [INFO] Final Memory: 14M/35M
          [INFO] ------------------------------------------------------------------------
          Archiving workspace
          Deleting old workspace snapshot from #412.
          Skipping Cobertura coverage report as mojo did not run.
          Finished: SUCCESS

          [2]
          [INFO] Cobertura Report generation was successful.
          [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
          Cobertura: Loaded information on 53 classes.
          Report time: 2237ms

          [INFO] Cobertura Report generation was successful.
          [INFO] ------------------------------------------------------------------------
          [INFO] Reactor Summary:
          [INFO]
          [INFO] Parent .............................................. SUCCESS [6.470s]
          [INFO] Model ............................................... SUCCESS [5.247s]
          [INFO] Web ................................................. SUCCESS [28.529s]
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESS
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 2:28.671s
          [INFO] Finished at: Wed Jul 25 14:35:39 WEST 2012
          [INFO] Final Memory: 14M/36M
          [INFO] ------------------------------------------------------------------------
          Archiving workspace
          Deleting old workspace snapshot from #413.
          Publishing Cobertura coverage report...
          Publishing Cobertura coverage results...
          Finished: SUCCESS

          Miguel Almeida added a comment - - edited I don't know what the OP meant with "the cobertura-maven-plugin is not invoked:". However, in 1.5 the plugin is not producing the reports for a multi-module maven project of mine. Details: Multi-module project Maven project Goal: install Post-steps: cobertura:cobertura Result: No coverage report produced (xml is in the workspace) [1] Same setup, plugin version 1.3: Coverage report produced correctly [2] [1] [INFO] Cobertura Report generation was successful. [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Cobertura: Loaded information on 53 classes. Report time: 1670ms [INFO] Cobertura Report generation was successful. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Parent .............................................. SUCCESS [2.882s] [INFO] Model .............................................. SUCCESS [5.370s] [INFO] Web ................................................. SUCCESS [33.970s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2:40.478s [INFO] Finished at: Wed Jul 25 13:08:43 WEST 2012 [INFO] Final Memory: 14M/35M [INFO] ------------------------------------------------------------------------ Archiving workspace Deleting old workspace snapshot from #412. Skipping Cobertura coverage report as mojo did not run. Finished: SUCCESS [2] [INFO] Cobertura Report generation was successful. [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Cobertura: Loaded information on 53 classes. Report time: 2237ms [INFO] Cobertura Report generation was successful. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Parent .............................................. SUCCESS [6.470s] [INFO] Model ............................................... SUCCESS [5.247s] [INFO] Web ................................................. SUCCESS [28.529s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2:28.671s [INFO] Finished at: Wed Jul 25 14:35:39 WEST 2012 [INFO] Final Memory: 14M/36M [INFO] ------------------------------------------------------------------------ Archiving workspace Deleting old workspace snapshot from #413. Publishing Cobertura coverage report... Publishing Cobertura coverage results... Finished: SUCCESS

          drautureau added a comment -

          Miguel: I guess you are having the issue because you run cobertura:cobertura in a post action of the build. That's why you are having the message Skipping Cobertura coverage report as mojo did not run. in the log.
          I guess that if you add "cobertura:cobertura" in the goal of the main step you will not run into this issue anymore.

          Adding it I solved the issue but I consider this as a workaround for my case because grails uses the cobertura library and not the cobertura-maven-plugin.

          I should have said "Cannot plublish cobertura reports if org.codehaus.mojo:cobertura-maven-plugin is not invoked in the main step of a maven build".

          drautureau added a comment - Miguel: I guess you are having the issue because you run cobertura:cobertura in a post action of the build. That's why you are having the message Skipping Cobertura coverage report as mojo did not run. in the log. I guess that if you add "cobertura:cobertura" in the goal of the main step you will not run into this issue anymore. Adding it I solved the issue but I consider this as a workaround for my case because grails uses the cobertura library and not the cobertura-maven-plugin. I should have said "Cannot plublish cobertura reports if org.codehaus.mojo:cobertura-maven-plugin is not invoked in the main step of a maven build ".

          @drautureau - that would be true if it had the same behaviour in 1.3. However, in 1.3 the coverage reports are added as expected...

          Miguel Almeida added a comment - @drautureau - that would be true if it had the same behaviour in 1.3. However, in 1.3 the coverage reports are added as expected...

          Ryan Campbell added a comment -

          It looks like the cobertura plugin is broken for all but Maven 2/3 project types. This seems to be due to this pull request: https://github.com/jenkinsci/cobertura-plugin/pull/6

          Ryan Campbell added a comment - It looks like the cobertura plugin is broken for all but Maven 2/3 project types. This seems to be due to this pull request: https://github.com/jenkinsci/cobertura-plugin/pull/6

          Roland Asmann added a comment -

          Any news on this for v1.6 or 1.7 of the plugin?

          Roland Asmann added a comment - Any news on this for v1.6 or 1.7 of the plugin?

          Code changed in jenkins
          User: Seiji Sogabe
          Path:
          src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
          src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config.jelly
          src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config.properties
          src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config_ja.properties
          src/test/java/hudson/plugins/cobertura/CoberturaPublisherTest.java
          http://jenkins-ci.org/commit/cobertura-plugin/46f5af5abf7750f751231fd32239fce7bd982fc4
          Log:
          [FIXED JENKINS-14552] added "fail builds if no reports" option instead of checking valid mojo was invokued

          Compare: https://github.com/jenkinsci/cobertura-plugin/compare/5f0962f0b2ad...46f5af5abf77

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Seiji Sogabe Path: src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config.jelly src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config.properties src/main/resources/hudson/plugins/cobertura/CoberturaPublisher/config_ja.properties src/test/java/hudson/plugins/cobertura/CoberturaPublisherTest.java http://jenkins-ci.org/commit/cobertura-plugin/46f5af5abf7750f751231fd32239fce7bd982fc4 Log: [FIXED JENKINS-14552] added "fail builds if no reports" option instead of checking valid mojo was invokued Compare: https://github.com/jenkinsci/cobertura-plugin/compare/5f0962f0b2ad...46f5af5abf77

            stephenconnolly Stephen Connolly
            drautureau drautureau
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: