So while developing spark programs, I use my local machine and hence have to setMaster to "local". However, when I submit the jar built from my locally developed program, I want to obviously not use "local" mode.
How can I make use of perhaps typesafeconfig to set "local" when testing and "yarn-cluster" when in production?
EDIT:
Based on the solution from @Shaido, for IDEA Intellij:
Go to: Run->edir confirgurations->Under application configuration set:
VM options = -Dspark.master=local[*]