I use the DSL plugin on Jenkins to create free-style and pipeline jobs. Both jobs requires a lockable resource.
In the pipeline job I configured the lock