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

Cobertura reports are not generated for maven2 projects

XMLWordPrintable

    • Icon: Patch Patch
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • cobertura-plugin
    • None
    • Platform: All, OS: All

      The cobertura plugin does not generate reports for maven2 based projects. The
      problem ist that the cobertura plugin is programmed against a deprecated api.
      Take a look at the patch below:

      Index: src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
      ===================================================================
      — src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java (revision 9030)
      +++ src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java (working copy)
      @@ -186,7 +186,7 @@
      /**

      • {@inheritDoc}

        */

      • public boolean perform(Build<?, ?> build, Launcher launcher, BuildListener
        listener) throws InterruptedException, IOException {
        + public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
        BuildListener listener) throws InterruptedException, IOException {
        if (!Result.SUCCESS.equals(build.getResult())) { listener.getLogger().println("Skipping Cobertura coverage report as build was not successful..."); return true; @@ -191,8 +191,9 @@ listener.getLogger().println("Skipping Cobertura coverage report as build was not successful..."); return true; }

        +
        listener.getLogger().println("Publishing Cobertura coverage report...");

      • final Project<?, ?> project = build.getParent();
        + final Project<?, ?> project = (Project<?, ?>) build.getProject();
        final boolean multipleModuleRoots;
        if (project.getScm() instanceof SubversionSCM) {
        // hack of the first kind

            mindless Alan Harder
            rlink77de rlink77de
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: