Find more details about how to skip tests with Maven. We can use mvn -DskipTests spring-boot:run to skip tests execution.
Let’s use curl command to check if our application is up and running properly:Ĭ:\Users\Asus>curl Welcome to Now, open the browser and type: localhost:8080. BUILD SUCCESS -Īs we can see in the maven log, the application is started with success. 23:26:39.647 INFO 13172 - c. : No active profile set, falling back to default profiles: default 23:26:39.586 INFO 13172 - c. : Starting MainClassApp using Java 16.0.1 on DESKTOP-77TR72O with PID 13172 (C:\Users\Asus\GIT\spbootexample\target\classes started by Asus in C:\Users\Asus\GIT\spbootexample) To do so, we need to navigate to the root directory of the project and run:Ĭ:\Users\Asus\GIT\spbootexample>mvn spring-boot:run For example, it provides spring-boot:run to help us run a Spring Boot app with Maven. The plugin offers a set of goals, each goal has a specific purpose. Please bear in mind that Spring Boot Maven plugin requires Maven 3.2 or later. To work with this plugin, we need to add it in the plugins section of the pom.xml: spring-boot-maven-plugin Spring Boot Maven plugin provides a convenient way to package a project into a JAR/WAR file, run Spring Boot applications or generate build information.
Feel free to take a look at how to build a REST API in Spring Boot.
n(MainClassApp.class, tells Spring to consider MainClassApp as a restful controller. To make things simple, let’s build an application with a single main class.įor instance, consider MainClassApp.java class. Run Spring Boot App With Mavenįirst, we are going to create a basic Spring Boot application. We will assume here that you have already installed and configured Maven on your machine and you are familiar with how to create Spring Boot applications.
Then, we will explain how to execute a Spring Boot app Using java -jar. We will first start with a little insight into the mvn spring-boot:run command. In this short tutorial, we are going to shed light on how to run Spring Boot application with Maven.