Vadym Borys
Vadym Borys

Reputation: 135

Compile and run Spring project with maven

I saw a lot of spring projects based on maven pom.xml build file. And there was one strange thing: project built without public static void main() method. For example: https://github.com/geowarin/spring-mvc-security. In usual examples form spring.io there are classes with @SpringBootApplication annotations and SpringApplication.run(Application.class, args); in main functions. So, how maven builds applications without this class and how to do it right way in terminal?

Upvotes: 0

Views: 1071

Answers (1)

Akshay Thorve
Akshay Thorve

Reputation: 718

Go to home directory of the project in the Terminal. Type below command.

mvn spring-boot:run

Output for my project:

enter image description here

Upvotes: -1

Related Questions