Skip to main content
Version: QB14

Auto-Trigger Dependent Maven Builds

Situation

When a new snapshot version of a Maven library is generated, triggers all configurations using this snapshot library automatically.

Demonstration

  1. In the demo set up, configuration Product1 and Product2 are maven configurations whose POM declared dependency to the library artifact which is built by configuration Library.
  2. Run the Library configuration to generate a new snapshot of the library artifact.
  3. After the build finishes, new build of Product1 and Product2 will be fired automatically to do the verification.

Resolution

  1. Check maven plugin setting in page Administration/Plugin Management , and make sure that the option Resolve Effective POM has been enabled.
  2. Visit general setting of the Library configuration, the Trigger Dependents option is checked.
  3. Visit step definition of the Library configuration, the maven build step simply calls Maven to build the library artifact. Maven goal does not matter here.
  4. Visit step definition of the Product1 configuration, the maven build step simply calls Maven to build product1. POM file of product1 (brough to workspace by checkout step) contains dependency declaration to library artifact. Maven goal does not matter here.
  5. Visit step definition of the Product2 configuration, the maven build step simply calls Maven to build product2. POM file of product2 (brough to workspace by checkout step) contains dependency declaration to library artifact. Maven goal does not matter here.