etig etig - 10 months ago 117
Java Question

Specify main class Spring-Boot command line

I use maven plugin to set the main class like this :


But sometimes I want run my app with another main class. What is the command line arguments to do this?

java -jar myapp-1.0.jar ...


Answer Source

There's a launcher for that in Spring Boot already. You need to build the jar with that as the Main-Class (by setting the layout in the build config).