Hi,
I'm using jenkins jobDSL plugin to generate my pipeline jobs from a groovy script, where I'm trying to create a multibranchPipelineJob as you can in the following line
17 multibranchPipelineJob("projects/${project_name}/${component_name}") {
18 branchSources {
19 branchSource {
20 source {
21 git {
22 remote(component.repository)
23 credentialsId(component.credentials)
24 traits {
25 branchDiscoveryTrait()
26 cleanBeforeCheckoutTrait()
27 }
28 }
29 }
30 strategy {
31 defaultBranchPropertyStrategy {
32 props {
33 }
34 }
35 }
36 }
37 }
38 triggers {
39 periodic(5)
40 }
41 orphanedItemStrategy {
42 discardOldItems {
43 // numToKeep(20)
44 }
45 }
46 if (component.jenkinsfile) {
47 factory {
48 workflowBranchProjectFactory {
49 scriptPath(component.jenkinsfile)
50 }
51 }
52 }
53 }
When the main pipeline job executing this code runs, it raises this (apparently know) error :
> ERROR: Found multiple extensions which provide method
> branchDiscoveryTrait with arguments []:
> [[com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait,
> jenkins.plugins.git.traits.BranchDiscoveryTrait,
> org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait]]
I've searched and see many results where people say that we should add `@Symbol` annotations to the `traits` implementations or to the relevant descriptors.
But I don't understand exactly what to do and where to place that @Symbol, people seem to say it solves the issue, but there is nowhere a good explanation and guidance to apply the fix.
Please what should I do where should the modification be done in the plugin code or elsewhere?
Best regards,
Eugène NG