Specify main class Spring-Boot command line

etig :

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

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
    <mainClass>com.myapp.main.MainClass</mainClass>
</configuration>
</plugin>

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 ...

Thx

Dave Syer :

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).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

spring boot with no main class

How to specify a different main class when running a scala jar on the command line?

Spring boot ignores main class

Spring Boot: Renaming the Main class

How to specify simulation class of Gatling in command line

Spring Boot -- ClassNotFoundException, but the main class exists

Spring Boot Program cannot find main class

Spring Boot unit test executing the main class

Exception in main class in Spring Boot Application

How to specify multiple schedulers on the kernel boot command line?

Spring Boot not obeying command line arguments

How to get command Line arguments in spring boot?

Testing a Spring Boot command line application

Using Spring Boot profiles with command line arguments

Passing multiple arguments in command line Spring Boot

How to see specify class list in spring-boot?

spring boot command line run not using logback-spring.xml

Cannot load or find main class, works in command line but not in IDE's

How to pass command-line arguments to main class in gradle?

Could not find or load main class when running through command line

"Could not find or load main class" using command line

Java command line error (could not find or load main class)

Run java main class in command line/batch file/python script

Run an ephemeral Spring Boot app out of main class or a startup listener?

Gradle building Spring Boot library without Main Class

spring-boot Maven: How to create executable jar with main class?

"Unable to find main class" with Maven on spring-boot project in Eclipse

How to test main class of Spring-boot application

How to test main class of Spring-boot application