Starting Spring boot applications from script

前端 未结 4 1007
醉梦人生
醉梦人生 2021-01-17 04:28

Using normal spring mvn commands, I can start a spring boot application from command line and terminate it with Control+c. I however have created a bunch of services which I

4条回答
  •  迷失自我
    2021-01-17 05:15

    You can launch each jar with the following command (in a bash script):

    java -jar service1.jar &
    

    Then, you can kill each process with the following command (in a bash script):

    pkill -f service1.jar
    

    pkill will terminates all processes containing the provided name. Be careful that your keyword only identifies your process, so you don't terminate other processes by mistake.

提交回复
热议问题