Skip to content

[JENKINS-61043] @Grab ignores package version if bundled in plugin #379

@jenkins-infra-bot

Description

@jenkins-infra-bot

When using @​Grab with a package that is already bundled inside a plugin, the version inside the plugin is used instead of the one defined in @​Grab.

Example to reproduce:

  1. Install Blue Ocean plugin (1.22.0) on vanilla Jenkins (2.204.2) (make sure AWS Steps plugin is not installed).
  2. Create a pipeline job with the following content and disabled sandbox:
@​Grab('org.yaml:snakeyaml:1.19')
import org.yaml.snakeyaml.LoaderOptions
LoaderOptions options = new LoaderOptions()
options.setAllowDuplicateKeys(false)

Result:

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.yaml.snakeyaml.LoaderOptions.setAllowDuplicateKeys() is applicable for argument types: (java.lang.Boolean) values: [false]

 Without Blue Ocean plugin installed the job is able to execute the method.


Originally reported by terbs, imported from: @Grab ignores package version if bundled in plugin
  • assignee: vjuranek
  • status: Open
  • priority: Major
  • component(s): workflow-cps-global-lib-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251212-090250
Raw content of original issue

When using @Grab with a package that is already bundled inside a plugin, the version inside the plugin is used instead of the one defined in @Grab.

Example to reproduce:

  1. Install Blue Ocean plugin (1.22.0) on vanilla Jenkins (2.204.2) (make sure AWS Steps plugin is not installed).
  2. Create a pipeline job with the following content and disabled sandbox:
@Grab('org.yaml:snakeyaml:1.19')
import org.yaml.snakeyaml.LoaderOptions
LoaderOptions options = new LoaderOptions()
options.setAllowDuplicateKeys(false)

Result:

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.yaml.snakeyaml.LoaderOptions.setAllowDuplicateKeys() is applicable for argument types: (java.lang.Boolean) values: [false]

 Without Blue Ocean plugin installed the job is able to execute the method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions