Status: Resolved (View Workflow)
Job Restrictions 0.8
I didn`t find documentation, how to use class restriction.
I want to allow running Pipeline jobs. So I choosed "Job class" restriction and typed:
In both cases I got error:
Class org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be resolved: java.lang.ClassNotFoundException: org.jenkinsci.plugins.workflow.job.WorkflowJob
- is related to
JENKINS-31866 Attempts to restrict Pipeline jobs from running on master result in job hanging
Here's how I configure the plugin today which works fine for pipelines. https://github.com/samrocketman/jenkins-bootstrap-shared/blob/21f76bb94f89dbbd56e8697482c861266c2b456a/scripts/configure-job-restrictions-master.groovy
btk3000 the root cause of the issue is likely job-restrictions is not validating against the uber classloader provided by the plugin manager.
The short version is you can safely ignore the "validation error" and it will just work. This bug report should track fixing the validation, though.
Which version do you use?
Starting from 2.111 (
JENKINS-46652) this tweak for Pipeline should not be required if you use Authorize project. To be landed in the next LTS
Regarding the error, it works for me. Are you sure that the Pipeline: Job plugin is actually installed on the instance?
btk3000 I opened a PR which fixes the error you experienced https://github.com/jenkinsci/job-restrictions-plugin/pull/23