I am using JCommander API for a Spring Boot - Spring Batch project.
Project has multiple jobs and I need to pass job name as parameter so I can launch specific jobs .
java -jar myJar.jar -jobName job1
Now, if my job1 is running and I wish to launch job2 at that time, I couldn't do that since port is already is in use. So I would be able to launch job2 only when job1 is finished.
If I try to launch job2 at different port ,
java -jar myJar.jar -jobName job2 --server.port=8090
then jCommander is not letting it through since I have not defined server.port in JCommander configuration and even if I do that , Spring Boot picks property from property file only and tries to run at same port - 8080.
How to handle this scenario?