I run my java main program with args using gradle application plugin's run task. The program uses picocli to parse command line args. This works fine when run in my Dev environment using following command:
./gradlew run --args="-ahttp://foo.com/bar -dmydeviceid"
It also runs fine when I ssh into a docker container for my apps docker image.
However, if I run the same Gradle run task in Spinnaker pipeline Run Job stage with same docker image it does not work. Log statements show that arguments are received by program correctly but are not processed by picocli. I am guessing it is because the code generator for picocli is not running in the Run Job of Spinnaker pipeline for some reason.
Any suggestions how to fix this.