Hi,

I got an issue when using @grab.
We are developing a jar and pipeline script to do the CI. We modify some 
java code, deploy onto our internal Nexus server, use @grab in groovy to 
fetch it to call the function.
During developing, we found when we modify some code, deploy a new SNAPSHOT 
version with the same version number of jar, sometimes the pipeline script 
is not working.

For example:

@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()


It works well, but if I deploy a new version to Nexus, it might fail, 
unless I restart the Jenkins, then it will work again.

error message:

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



I think it might be some cache in Jenkins, because restart Jenkins will fix 
it. But I can't find it.
Does anyone have any clue about this?
Thank you very much.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/56f3398c-9d7c-4192-96d1-bedaf7fb4adf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to