springboot idea to create a project (hello world)

1. Open the IDEA, click + Create New Project

Here Insert Picture Description

2. Locate and click on the Spring Initializr, click on the next menu on the left.

Note that this idea https://start.spring.io default template provided online, so it is necessary to ensure smooth network.
Here Insert Picture Description

3. Modify the project name, Maven Project (the project build tool), click next.

Here Insert Picture Description

4. Add dependent

Select a category from the left, and then check in the middle of the window needs to rely on. On the right you can see the dependencies you have selected.
You can also select the top right drop-down version of Spring Boot. Click Next when finished.
Creating infrastructure projects, do not rely on a lot of the election, web one is enough
Here Insert Picture Description

5. Set the Project Name / engineering directory

Setting the project name Project name and path to save the project Project location. When finished, click Finish.
Here Insert Picture Description

6. Wait IDEA building project

Here Insert Picture Description

7. Establish a good project structure

Here Insert Picture Description

8. write a hello world, to see the project can not start

@RestController
@SpringBootApplication
public class AlonApplication {

    public static void main(String[] args) {
        SpringApplication.run(AlonApplication.class, args);
    }

    @RequestMapping()
    public String hello(){
        return "hello spring boot \n 谢谢阅读!";
    }

}

Here Insert Picture Description

9. browser validation results http: // localhost: 8080

Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/todayforever/p/12583867.html