2

If I use File parameter in declarative way, it gives the exception below.

But the same command works fine in freestyle job.

Is there any way to upload file of any format (xls, properties) into Jenkins workspace using declarative way, if not File parameter?

java.lang.NullPointerException
at hudson.model.FileParameterValue.doDynamic(FileParameterValue.java:205)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
at org.kohsuke.stapler.MetaClass$11.dispatch(MetaClass.java:397)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
Caused by: javax.servlet.ServletException

Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49
Kunal
  • 21
  • 1
  • 3
  • 1
    Please include the pipeline file that is causing this error and if needed review [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Stefan Crain Apr 16 '18 at 17:02
  • pipeline { agent any parameters { file description: 'some desc', name: 'abc.text' } stages { stage('Build') { steps { echo "error the file is not copied in workspace" } } } } most basic pipeline - which accepts file parameter from Jenkins UI. thanks @Stefan Crain for respondng so quick. – Kunal Apr 16 '18 at 19:41
  • I believe its similar to this: https://stackoverflow.com/questions/49833240/how-to-input-json-file-as-input-parameter-to-jenkins-job/49835306#49835306 – Ravindranath Barathy Apr 17 '18 at 04:56

0 Answers0