0

I Mean, that i DON´T want to create a Centralizer Main Class and pass parameter to it, so it can choose and start the @SpringBoot class for me...

In the other hand, I do not consider starting the classes with "java -cp ". This way it is not SpringBoot which starts the classes, but you are forcing manually the class to be started.

What i am looking for is an elegant built-in "Spring Way" to start my diferent @SpringBoot classes from command line. Any Special Launcher? Something in the App properties files?

What i realize is a Launcher which may receive "spring.application.name" for instance by command line and so use that to choose the desired @SpringBoot class.

  • Use [profiles](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html#howto-set-active-spring-profiles). – Boris the Spider Feb 08 '17 at 10:52

1 Answers1

0

You can not put multiple Main Classes in the Manifest.

What you can do is put the JAR in the classpath and call the main class

java -jar yourLib.jar will start the Main Class from manifest

java -cp youLib.jar your.1st.main.Class

java -cp youLib.jar your.2nd.main.Class

thopaw
  • 3,796
  • 2
  • 17
  • 24