Jenkins 1.561中的Poll SCM不触发build

升级了最新版本的Jenkins后,发现之前配置的Poll SCM不会触发build了。
Jenkins还是会去检查SCM上的更新,在Poll SCM下面还是会看到类似的提示信息
”Would last have run at Wednesday, May 7, 2014 5:45:11 AM CEST; would next run at Wednesday, May 7, 2014 5:50:11 AM CEST.“

jenkins-poll-scm-1

通过http://xxx/job/JOB-NAME/scmPollLog/查看pull log,会发现
Started on May 07, 2014 8:08:05 AM
We need to schedule a new build to get a workspace, but deferring 1,149ms in the hope that one will become available soon (all_suitable_nodes_are_offline)
Done. Took 1 ms
No changes

这个问题在Jenkins的JIRA里面有人提出来了,https://issues.jenkins-ci.org/browse/JENKINS-22750,目前还没有解决,但有其他办法绕过这个问题。这个文章的五楼有详细说明,http://jenkins-ci.361315.n4.nabble.com/No-new-jobs-are-created-after-upgrading-to-1-560-polling-plugin-reports-no-changes-when-there-are-td4699709.html

Log into your Jenkins web interface and go into ‘Manage Jenkins’ -> ‘Manage Nodes’, use the option on the left to add ‘New Node’. Give the node a name, doesn’t matter what, and choose the option ‘Dumb Slave’; click ‘ok’. Leave everything the way it is on the next page, you aren’t going to do anything with this node, and click ‘save’. This will enable the option to restrict where projects can run; this is only available if you have more than one node configured. Now go into each one of your jobs you are having a problem with and choose ‘configure’. In the top section you will now see an option for ‘Restrict where this project can be run’. Check that box and in the ‘Label Expression’ field type in ‘master’. You should now see below that box ‘Slaves in label: 1’. Click ‘Save’ on the that screen and that will fix the problem for that particular job. Leave the temporary node you added in case you need to add new polling jobs until this gets fixed.

步骤就是创建一个Dumb Slave,并且指定每一个需要触发build的job在master node上进行编译。

jenkins-poll-scm-2