Quickly Set Up a Spring Boot Project in IntelliJ IDEA

This step‑by‑step guide shows how to configure JDK 1.8 and Maven 3.6.2, create a new Spring Boot project in IntelliJ IDEA using Spring Initializr, examine the generated pom.xml, add a simple HelloController, and verify that the application runs successfully.

Test Development Learning Exchange
Test Development Learning Exchange
Test Development Learning Exchange
Quickly Set Up a Spring Boot Project in IntelliJ IDEA

Environment requirements: JDK 1.8 and Maven 3.6.2.

Creating the Project

In IntelliJ IDEA choose File → New → Project and select Spring Initializr . The built‑in plugin requires an internet connection; if the UI cannot load, download a starter zip from https://start.spring.io/ and import it manually.

After confirming the project metadata (group, artifact, packaging, Java version), click Next and finish the wizard. IDEA generates the standard Spring Boot directory layout, which can be inspected in the Project view.

Inspecting pom.xml

The generated pom.xml already contains the Spring Boot parent, core starter dependencies, and the Maven plugin configuration needed to package an executable jar. Comments in the file explain each section.

Adding a Simple Controller

Create a new Java class HelloController.java under the package com.example.springbootproject.controller with the following content:

package com.example.springbootproject.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {
    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello";
    }
}

Building and Running the Application

From the IDE or the command line, build the project with Maven: mvn clean package Run the generated jar (or use the IDE’s Run configuration):

java -jar target/<em>your-artifact-id</em>-0.0.1-SNAPSHOT.jar

Open a browser and navigate to http://localhost:8080/hello. The response should be the plain text string hello , confirming that the Spring Boot application is correctly set up.

These steps produce a minimal, runnable Spring Boot project that can be extended with additional controllers, services, and configuration as needed.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavamavenSpring BootIntelliJ IDEAControllerTutorial
Test Development Learning Exchange
Written by

Test Development Learning Exchange

Test Development Learning Exchange

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.