2
votes

I have some groovy script for generating jenkins jobs, which worked great. But after reinstallation of jenkins this script throws exception.

problem part of script is:

publishers {
            allure(['path-to/reports'])
        }

And error is:

Processing DSL script seed.groovy
ERROR: (JobBuilder.groovy, line 55) No signature of method:             
javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.allure() is     
applicable for argument types: (java.util.ArrayList) values: 
[[PyUIAutotest/reports]]
Possible solutions: mailer(java.lang.String), 
use([Ljava.lang.Object;), asType(java.lang.Class)
Finished: FAILURE

It fails on wrong signature of method, but it is correct, and i don't know what is wrong.

example of script available on wiki dock. and javadoc for allure() method

Jenkins ver. 2.46.2; Job DSL ver. 1.63, Allure-Jenkins-Plugin ver. 2.15

weird thing in that, i have another server with same plugin versions, and it works fine

2

2 Answers

0
votes

Instead of

publishers {
        allure(['path-to/reports'])
    }

use this syntax (which you can also generate using Jenkins pipeline-syntax generator):

allure([includeProperties: false, jdk: '', properties: [], reportBuildPolicy: 'ALWAYS', results: [[path: 'path-to/reports']]])
0
votes

You might find my answer here useful: https://stackoverflow.com/a/71082002/1169433

In short, you may need to add the allure-jenkins-plugin in your build dependencies.