[JIRA] (JENKINS-61043) @Grab ignores package version if bundled in plugin

27 views
Skip to first unread message

tobias.erbshaeusser@gmail.com (JIRA)

unread,
Feb 11, 2020, 4:10:03 AM2/11/20
to jenkinsc...@googlegroups.com
Tobias Erbshäußer created an issue
 
Jenkins / Bug JENKINS-61043
@Grab ignores package version if bundled in plugin
Issue Type: Bug Bug
Assignee: vjuranek
Components: groovy-plugin
Created: 2020-02-11 09:09
Priority: Major Major
Reporter: Tobias Erbshäußer

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)
  1. 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]

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

tobias.erbshaeusser@gmail.com (JIRA)

unread,
Feb 11, 2020, 4:12:03 AM2/11/20
to jenkinsc...@googlegroups.com
Tobias Erbshäußer updated an issue
Change By: Tobias Erbshäußer
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:
# Install Blue Ocean plugin (1.22.0) on vanilla Jenkins (2.204.2) (make sure AWS Steps plugin is not installed).
# Create a pipeline job with the following content and disabled sandbox:

 
{code:java}

@Grab('org.yaml:snakeyaml:1.19')
import org.yaml.snakeyaml.LoaderOptions
LoaderOptions options = new LoaderOptions()
options.setAllowDuplicateKeys(false)
{code}

#
Result:

{noformat}
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]{noformat}

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

tobias.erbshaeusser@gmail.com (JIRA)

unread,
Feb 11, 2020, 4:59:03 AM2/11/20
to jenkinsc...@googlegroups.com
Tobias Erbshäußer updated an issue
Change By: Tobias Erbshäußer
Component/s: workflow-cps-global-lib-plugin
Component/s: groovy-plugin
Reply all
Reply to author
Forward
0 new messages