Skip to main content
Version: QB14

Set up Static Dependency

Situation

ProductA and componentA build independently as different projects. During build process of productA, build result of specified version of componentA should be retrieved and used. This specified version will not change even if componentA has a new version.

Demonstration

  1. Visit latest build of productA, and hover mouse over the dependencies link in the build summary section, and you will see that current build depends on version 1.0.10 of componentA.
  2. Switch to componentA, and click the run button to generate a new version of componentA.
  3. Switch back to productA, and click the run button to build productA. When build finishes, examine dependency of the new build again, and it is still using version 1.0.10 of componentA.

Resolution

  1. Visit repository setting of productA. There are two repositories defined: componentA and productA . Repository productA is used to retrieve source code of productA from SCM, while repository componentA is used to retrieve build result of componentA. Repository componentA is defined to retrieve all published jars from version 1.0.10 of componentA.
  2. Visit step setting of productA. Two checkout steps are defined to checkout repository productA and componentA respectively.