@GrabResolver(name='Internal Nexus Snapshot', root='https://internal.nexus.com/')
@Grab('some-package:some-artifact:0.0.1-SNAPSHOT')
import some.Utils
println new Utils()
Running in Durability level: MAX_SURVIVABILITY org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 1: unable to resolve class some.Utils @ line 1, column 1. @GrabResolver(name='Internal Nexus Snapshot', root='https://internal.nexus.com/') ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:958) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:554) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:290) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:421) Finished: FAILURE
We also found an issue about this: https://issues.jenkins-ci.org/browse/JENKINS-48974, this will cause the parallel jobs which @grab the same direct/indirect dependencies failed.
It seems related to the groovy/ivy issue: https://issues.apache.org/jira/browse/GROOVY-7407. And it’s not fixed yet…
We also consider the way of @Library, but in the groovy lib, we still need @grab 3rd party lib, which is the same situation.