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
- 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.
- Run the Library configuration to generate a new snapshot of the library artifact.
- After the build finishes, new build of Product1 and Product2 will be fired automatically to do the verification.
Resolution
- Check maven plugin setting in page Administration/Plugin Management , and make sure that the option Resolve Effective POM has been enabled.
- Visit general setting of the Library configuration, the Trigger Dependents option is checked.
- 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.
- 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.
- 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.