Hi,

I have a scripted pipeline and want to add a call to the ClamAV plugin.
If I manually configure a working freestyle job that runs the ClamAV
plugin I see the following in the config.xml:
   <publishers>
     <org.jenkinsci.plugins.clamav.ClamAvRecorder plugin="[email protected]">
           <includes>**</includes>
     </org.jenkinsci.plugins.clamav.ClamAvRecorder>
   </publishers>

Since I want to call ClamAV in a pipeline I put this snippet in there:
   import org.jenkinsci.plugins.clamav.ClamAvRecorder
   [...]
   step ([$class: 'ClamAvRecorder', includes: "**", excludes: "" ])

However I am getting the following exception:

java.lang.IllegalArgumentException: java.lang.ClassCastException@79aed164
        at sun.reflect.GeneratedConstructorAccessor177.newInstance(Unknown 
Source)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:289)
        at 
org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:205)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:262)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:176)
        at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
        at sun.reflect.GeneratedMethodAccessor6075.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
        at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:158)
        at 
org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
        at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
        at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:156)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:160)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
        at 
com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
Caused: java.lang.IllegalArgumentException: Could not instantiate 
{delegate={$class=org.jenkinsci.plugins.clamav.ClamAvRecorder, includes=**, 
excludes=}} for CoreStep(delegate: 
SimpleBuildStep{AnalysisPublisher(androidLintActivated?:



Any idea how I can call ClamAV so it works?

Thanks,
Martin

PS: I'd be grateful for any other hints on scanning build results for malware

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/20190703081143.GF17110%40sourco.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to