在 Jenkins 中构建当前项目之前,在 SCM 更改时构建一些其他项目

Build some other project when SCM changes before building current project in Jenkins

我在 Jenkins 中有三个 Maven 项目。其中两个与另一个相关;这意味着在项目 A and/or B 中进行需要在项目 C 中进行。因此,每当要构建项目 A and/or 项目 B 时,我应该预先构建项目 C。我想做的是:

If SCM of A has changed Then
    Build C
    Build A
Else If SCM of B has changed Then
    Build C
    Build B

现在我想知道如何告诉 Jenkins 使用其选项和插件执行此操作。如果有 none,任何帮助编写用于执行此任务的脚本的帮助也将不胜感激!

How do I trigger another job from hudson as a pre-build step? 或许能帮到你。

那里提到了一个名为 PreBuild 的插件: http://wiki.jenkins-ci.org/display/JENKINS/PreBuild+Plugin