source{
git {
credentialsId('x')
remote('ssh://x@x:22/x/x/' + projectName)
traits {
gitBranchDiscovery()
extensions {
sparseCheckoutPaths {
sparseCheckoutPaths{
sparseCheckoutPath {
path(jenkinsFile)
}
}
}
}
}
}
}
They moved this inside of traits, before was outside traits when leaved outside of traits triggers depreactiaton , can be checkd at:
https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html#path/jenkins.scm.api.SCMSource$$List.git