Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-13208

Improve Automatic Clover integration for multi-module maven builds

    XMLWordPrintable

    Details

    • Feedback Policy:

      Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Description

      Currently, it's planned to deliver the feature in two steps:

      • Bamboo 5.8 - changes in Bamboo Clover Plugin UI
      • Bamboo 5.9 - enabling this feature by upgrading dependency to Clover 4.0.3+

      Problem:
      A build can fail during test execution in case when Automatic Clover integration is used and the project is a Maven project with multiple modules having dependencies between each other.

      Scenario:

      MasterModule
        /ModuleA
        /ModuleB
      

      Maven goal is called: clean test. Compilation order will be:

      MasterModule clean
      MasterModule test
      ModuleB clean
      ModuleB test
      ModuleB jar <-- JAR is created
      ModuleA clean
      ModuleA test  <-- using ModuleB.jar in classpath 
      

      What happens when Automatic Clover integration is enabled? Goals are enhanced as follows: clean test clean clover2:setup verify clover2:aggregate clover2:clover. What happens? A compilation is as follows:

      ModuleB clean
      ModuleB test
      ModuleB clean
      ModuleB clover2:setup
      ModuleB verify
      ModuleB jar <-- JAR is created with instrumented classes!
      ModuleA clean
      ModuleA test  <-- using ModuleB.jar in classpath with instrumented classes, but we're before clover2:setup so clover.jar artifact is not available, build fails
      //expected to have ModuleA clover2:setup verify ...
      

      Issue affects all Bamboo versions.

      Possible improvement:

      1) Analyze which goals are defined in Maven task. Next add Clover goals in between:

      • add "clover2:setup" after the "clean" (if present) and before other goals
        • but "jaxb2:generate clover2:setup"
        • but "wsdl2java clover2:setup"
      • what to do in case when "install" or "deploy" phase is declared? deploying instrumented JARs shall be avoided in general
        • write help for "automatically integrate clover" radio button?
        • write warning in UI if such goals are found?
        • write warning in a build log if such goals are found?
      • add "clover2:aggregate clover2:clover" after all goals

      2) Alternatively, call Clover first and clean everything after Clover finishes, e.g. something like:

      mvn clean clover2:setup verify clover2:clover clean <original goals>
      

      but this causes a problem that all Clover reports will be wiped out after last clean. They'd have to be stored somewhere.

      3) Alternatively, we could add an extra Maven task at the end of the Job with would run "clean" + Clover goals. But this would change build configuration.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mparfianowicz Marek Parfianowicz
              Reporter:
              mparfianowicz Marek Parfianowicz
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: