Home > Java > javaTutorial > What are the ways to create springboot projects in eclipse

What are the ways to create springboot projects in eclipse

WBOY
Release: 2023-05-22 19:19:04
forward
2948 people have browsed it

Method 1

Install STS plug-in

What are the ways to create springboot projects in eclipse

What are the ways to create springboot projects in eclipse

## After the installation of the plug-in guide window is completed, the progress of installing the plug-in will appear in the lower right corner of eclipse. After the plug-in installation is completed, restart eclipse to take effect.

New spring boot project

What are the ways to create springboot projects in eclipse

What are the ways to create springboot projects in eclipse

Project Start

What are the ways to create springboot projects in eclipse

##Method 2

1.Create Maven project

What are the ways to create springboot projects in eclipse2.Select project type

What are the ways to create springboot projects in eclipse3.Select project

What are the ways to create springboot projects in eclipse4. Write the project group and name -finish

##5. Modify the pom.xml fileWhat are the ways to create springboot projects in eclipse

<!-- spring boot基本环境 -->
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
</parent>
Copy after login

6.Add dependencies in pom.xmlWhat are the ways to create springboot projects in eclipse

<!--web应用基本环境配置 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
Copy after login

7.Add compilation plug-in in pom.xmlWhat are the ways to create springboot projects in eclipse

<build>
    <plugins>
    <!-- spring-boot-maven-plugin插件就是打包spring boot应用的 -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins
</build>
Copy after login

8. Basic packages and classesWhat are the ways to create springboot projects in eclipse

9. Create resources folder and application.properties fileWhat are the ways to create springboot projects in eclipse

10.App.javaWhat are the ways to create springboot projects in eclipse

package com.springboot.springbootDemo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class App
{
    public static void main( String[] args )
    {
        SpringApplication.run(App.class, args);
    }
}
Copy after login

11.HelloController.javaWhat are the ways to create springboot projects in eclipse

package com.springboot.springbootDemo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("hello2")
public class HelloController {
       @RequestMapping("")
       public String hello() {
              return "helloworld2";
       }
}
Copy after login

12. Start the projectWhat are the ways to create springboot projects in eclipse

13. Access the project (lower versions may not be accessible, version 2 is available)What are the ways to create springboot projects in eclipse

http://localhost:8012/hello2

What are the ways to create springboot projects in eclipseMethod 3

Visit http://start.spring.io/

Click Generate Project to download the project compressed packageWhat are the ways to create springboot projects in eclipse

After decompressing, use eclipse, Import -> Existing Maven Projects -> Next ->Select the decompressed folder- > Finsh, OK done!

The above is the detailed content of What are the ways to create springboot projects in eclipse. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template