Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the complete steps for creating a springboot project

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

What is the complete step to create a springboot project? I believe many inexperienced people are helpless about this. For this reason, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

How to Create Spring Boot Project

Is there a quick way to learn how to create a spring boot project quickly? The answer is yes. Let's quickly create a spring boot project and get it running.

We create today in two ways, online and using IntelliJ IDEA.

1 Created online

1.1 Open https://www.example.com in your browser start.spring.io/

1.2 Project Select Maven Project, Language Select Java, Spring Boot version 2.1.5, Group We can enter com.sunshine, Artifact (project name or module name) We can enter quick_demo, click More options, We can enter project name, description, package name, packaging method and JDK version, Our settings are as follows:

1.3 Select dependencies, because we want to create a web project, so type web, and click, and the selected dependencies will be displayed on the right:

1.4 Click the Generate Project button and find that a zip package named quick_demo.zip has been generated and downloaded locally:

1.5 Unzip and import it into IDEA. It is found that this is a complete project with directory structure. So far, the online creation of spring boot is completed. The startup validation section is placed after IntelliJ IDEA creation, and you can skip IntelliJ IDEA creation directly.

2 Created using IntelliJ IDEA

2.1 We open IntelliJ IDEA by clicking File ->New - Project:

2.2 Check Spring Initializr in the pop-up box below and click Next:

2.3 Group Enter com.sunshine, Artifact (project name or module name) You can enter quick_demo, Type Select Maven Project, Language Select Java, Packaging Mode Select Jar, Java Version Select 8, We can enter project name, description and package name, Our settings are as follows, Click Next:

2.4 In the pop-up box below, select the web project dependencies we want and the version number of spring boot, and then click Next:

2.5 Set the project name and project address, click Finish:

2.6 The directory structure for processing from online creation and creation using IntelliJ IDEA is essentially the same:

3 Start validation

3.1 We first create a package named controller under the root package path, and create the QuickDemoController controller class under the package, and write the interface method quickDemo, as shown in the following code:

@RestControllerpublic class QuickDemoController { @GetMapping("/quickDemo") public String quickDemo(){ return "this is quick demo for Spring Boot! "; }}

3.2 We start the spring boot project by starting the QuickDemoApplication main method:

3.3 Browser type http://localhost:8080/quickDemo Verify

4 summarizes

You can create Spring Boot projects quickly by creating them online (https://start.spring.io/) and IntelliJ IDEA; in fact, the Spring Initializr template is used to create them; the advantage of creating Spring Boot quickly is that we write a lot less configuration information and automatically generate a complete project structure; if there are any dependencies in the creation process, remember to select them, or you have to configure them in the pom file.

After reading the above, do you know how to create a springboot project? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report