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

Cobertura fails the build if post build action of clean is specified

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • cobertura-plugin
    • None

      We need to keep disk space usage to a minimum, so we run mvn clean after every build.
      Unfortunately, with the post-build steps available in jenkins, the mvn clean runs before the cobertura report gets a chance to collect its data. So it complains that it cannot find coverage.xml and fails the build.

      The workaround we have is to use the m2extra steps plugin (which was deprecated after jenkins introduced the pre and post build capability). The m2extra steps plugin runs after the cobertura plugin.

          [JENKINS-13840] Cobertura fails the build if post build action of clean is specified

          scooper4711 added a comment -

          Actually, now I can't get the m2 extra steps to happen last anymore. So there is no work-around.

          scooper4711 added a comment - Actually, now I can't get the m2 extra steps to happen last anymore. So there is no work-around.

          sogabe added a comment -

          change outputDirectory not to be removed.

             <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                  <formats>
                    <format>html</format>
                    <format>xml</format>
                  </formats>
                  <outputDirectory>not_target_dir/cobertura</outputDirectory>  <!-- here
                </configuration>
              </plugin>
          

          sogabe added a comment - change outputDirectory not to be removed. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.1</version> <configuration> <formats> <format>html</format> <format>xml</format> </formats> <outputDirectory>not_target_dir/cobertura</outputDirectory> <!-- here </configuration> </plugin>

          scooper4711 added a comment - - edited

          Hmm. Why didn't I think of that?
          Thanks!

          scooper4711 added a comment - - edited Hmm. Why didn't I think of that? Thanks!

          scooper4711 added a comment -

          Of course, this makes generating the web-site on a nightly basis more difficult. :/

          scooper4711 added a comment - Of course, this makes generating the web-site on a nightly basis more difficult. :/

            stephenconnolly Stephen Connolly
            scooper4711 scooper4711
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: