SpringBoot框架搭建web服务

 时间:2026-02-14 04:51:40

1、使用intellij新建一个maven工程,注意不用勾选archetype,点击下一步

SpringBoot框架搭建web服务

2、按照提示填写groupId和artifactId以及项目名称等信息,点击Finish

SpringBoot框架搭建web服务

SpringBoot框架搭建web服务

3、打开pom.xml,添加以下内容:

<parent>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-parent</artifactId>    <version>2.0.0.RELEASE</version</parent<build>    <plugins>        <plugin>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-maven-plugin</artifactId        </plugin>    </plugins></build><dependencies>    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-web</artifactId>    </dependency</dependencies>

SpringBoot框架搭建web服务

4、编写启动类,并运行main方法

SpringBoot框架搭建web服务

5、SpringBoot搭建web服务到这里就完成了,打开浏览器,输入http://localhost:8080/

SpringBoot框架搭建web服务

  • css如何设置table单元格的行高
  • jquery实现点击按钮添加和移除class
  • sql server如何固定查询窗口
  • C#的Razor中如何使用母版页
  • css如何让图片的边框有发光效果
  • 热门搜索
    计步器什么牌子好 历历在目是什么意思 不俗气的简短祝福语 奶瓶什么材质的最好 多愁善感意思 父亲节祝福语 borrow是什么意思 电烤箱什么牌子好 大宝眼霜适合什么年龄 去医院看病人送什么好