I tried to trick it like this, and that's the closest I could get to making 
it work (but unfortunately it does not work, see below):

        step([$class: 'hudson.plugins.cobertura.CoberturaPublisher',
              coberturaReportFile: 
'.ci/coverage-cobertura/cobertura-coverage.xml',
              onlyStable: false,
              failUnhealthy: false,
              failUnstable: false,
              autoUpdateHealth: false,
              autoUpdateStability: false,
              zoomCoverageChart: false,
              failNoReports: true,
              sourceEncoding: 'ASCII'
        ])

(I got the class name and field names from another job's config.xml, did 
not really look it up in any documentation. I know I miss the 
healthyTarget, unhealthyTarget, failingTarget fields, but those are some 
complex structures, and I really don't know how to set them.)

But something is wrong, I got some generic error (I tried it with Jenkins 
2.10):

java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:193)
        at 
org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:104)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:134)
        at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:113)
        at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
        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:151)
        at 
org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
        at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:101)
        at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
        at 
com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:15)
        at WorkflowScript.run(WorkflowScript:133)
        at ___cps.transform___(Native Method)
        at 
com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:55)
        at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106)
        at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79)
        at sun.reflect.GeneratedMethodAccessor484.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
        at sun.reflect.GeneratedMethodAccessor487.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at 
com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
        at com.cloudbees.groovy.cps.Next.step(Next.java:58)
        at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
        at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
        at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
        at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:29)
        at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:106)
        at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:29)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:276)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:78)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:185)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:183)
        at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
        at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

There is some room for improving this error message...

I tried to experiment with changing the boolean values to string, but then I 
got:

java.lang.ClassCastException: 
hudson.plugins.cobertura.CoberturaPublisher.onlyStable expects boolean but 
received class java.lang.String
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:317)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:248)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:192)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:305)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:248)
        at 
org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:192)
        at 
org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:104)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:134)
...

So that did not help, so undone this change, but as mentioned before it still 
fails with the generic "argument type mismatch" error.
If anyone knows how to fix this, please do not hesitate to post it!

Thx,
Attila



On Monday, April 25, 2016 at 7:20:52 PM UTC+2, Jan Chaloupecky wrote:
>
> Ok thanks,
> there is a open ticket for the Bitbucket notifier
> https://issues.jenkins-ci.org/browse/JENKINS-33841
>
> So this means that each plugin has to implement the pipeline support 
> before it can be used.
>
> thanks
> Jan
>
> On 25 April 2016 at 19:12:40, Mark Waite (mark.ea...@gmail.com 
> <javascript:>) wrote:
>
> The JUnit plugin has been extended to support pipeline.  Refer to 
> https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md for 
> an example of how to use it in a pipeline. 
>
> I don't see any mention of pipeline enabling changing in the BitBucket 
> Build Status Notifier Plugin or the Cobertura Plugin.
>
> Mark Waite
>
> On Mon, Apr 25, 2016 at 11:06 AM Jan Chaloupecky <jan.cha...@gmail.com 
> <javascript:>> wrote:
>
>> Hello, 
>> I have a Jenkinsfile in my project that triggers different build steps 
>> from checking out the sources through testing/building my project. I would 
>> like to know if I can call some other Jenkins plugins from the Jenkinsfile. 
>> In my non-pipeline projects I was using some "post build actions" such as 
>>
>>
>> https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+Build+Status+Notifier+Plugin
>> https://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin
>> https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Plugin
>>
>> Is this something that has to be implemented by the plugin itself or is 
>> there a way to call those plugins from the Jenkinsfile ?
>>
>> cheers,
>> Jan
>> --
>> 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-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/7f670704-51a6-4d95-ab22-a7f08746eb36%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/7f670704-51a6-4d95-ab22-a7f08746eb36%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the 
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-users/ZTaU0kUOqGU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> jenkinsci-use...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG-8E%3DafKyEK9cCrd%3D2mpjL7s8Yfoy7zThAN3q1vjFj_g%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG-8E%3DafKyEK9cCrd%3D2mpjL7s8Yfoy7zThAN3q1vjFj_g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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/d2b35566-a663-496b-86a1-ff0421581152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to