Thanks for response Jesse,
Yes i saw that @StepContextParameter is deprecated . i have basically two builder classes extending SimpleBuildStep which basically invokes our tool through command line. Before that i have Build wrapper class extending SimpleBuildWrapper which makes sure that the tools path is added in 'PATH' variable .
problem is above works fine when run using freestyle project however when i cosnstruct a pipeline DSL code then builder fails to invoke the tool as my build step in pipeline does not know where my tool is . (even though it is set in my BuildWrapper class). Please help me with this i have been stuck on this issue from quite a time now . not sure what am i doing wrong here , attaching link to my project
please check
Build Wrapper Class
Builder Classes
pipeline code that i am trying but does not work is as below.
pipeline {
agent any
stages{
stage('Run MATLAB Command') {
steps
{
Matlab(matlabRootFolder:'C:\\Program Files\\MATLAB\\R2019b')
{
RunMatlabCommand(matlabCommand:'ver;pwd')
// is i replace above step with echo bat('cmd.exe /C matlab -batch pwd') then it works
}
}
}
}
}