Home Programming Creating a Spring Boot Project With Eclipse and Maven

Creating a Spring Boot Project With Eclipse and Maven

1166
0

In this article we will learn how to create a Spring boot application using Spring Initializr.

For this you need to have:

  1. Maven 3.0+ is as your build tool.
  2. Eclipse IDE (You can use any)
  3. JDK 1.8+

Step 1:

Go to Spring Initializr website https://start.spring.io

Step 2:

Once you will open the website you will see a lot of options.

As you can see in above image

  1. Select Maven Project as your project.
  2. Select Java under language.
  3. Spring boot version 2.3.0 (or you can select any version).
  4. Under Project Metadata type the following
    • Group:com.techopaths.springboot
    • Artifact:demo
    • Name:Spring Boot Demo
    • Description:Demo project for Spring Boot
    • Package name:com.techopaths.springboot.demo
  5. Jar for packaging.
  6. And Java version 8.

In next step we will provide the dependecies which are required in our project.

Step 3:

Spring initializr also provide us the option to specify the dependencies. To add a dependency click on Add Dependencies. A popup will open.

As we are building a web application so click on Spring Web as shown in below image

Step 4:

We have provided all the information.

Now click on Generate. This would download a ZIP file to your local machine.

Step 5:

Our final step is to import the project in Eclipse IDE.

Follow the below steps:

  1. Open your Eclipse IDE.
  2. Click on File-> Import -> Existing Maven Projects-> Click on next.
  3. Click on Browse and select the project location -> Click on Finish.
  4. The project will be imported and dependencies will be downloaded.

To run this application right click on SpringBootDemoApplication.java file and then click on Run as-> Java Application.

To open the application, enter http://localhost:8080 in your browser.

As there is no controller so we are getting this error.

So, by far we have learned how to create a new Spring project using Spring Initializr.

To download this project click here.

In next article we will learn more about Spring framework.

This site uses Akismet to reduce spam. Learn how your comment data is processed.