0
votes

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?

1
spring boot application and regular spring mvc application work in different ways. the git hub link you specified is a regular spring mvc application. It won't have any main method. Applications with main and with annotations as SpringBootApplication are spring boot applications, which are totally different in terms of packaging , building and starting the applicationpvpkiran
I'm a little confused about what you're trying to do, are you just curious why Spring MVC Security doesn't need a main method or are you wondering how to use Spring MVC Security in your project?Captain Man
"why Spring MVC Security doesn't need a main method?" and how to run it without this method? (in all readme files I found "mvn clean install", and after that nothing's happened)Vadym Borys

1 Answers

-1
votes

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