首先选择create new project

springboot学习(一)--创建springboot项目

选择Spring Initializr

springboot学习(一)--创建springboot项目

接着到了这个界面

springboot学习(一)--创建springboot项目

Group的填写:第一段一般是com;org等,一般com指的是盈利性组织,而org则相反,而第二段指的是公司的名称

Artifact:填写项目的名字

选择mave构建项目,打包的方式,jdk的版本

填写完成之后点击next

springboot学习(一)--创建springboot项目

这个界面是选择你的项目所需要的依赖,这里选择之后就直接将相关的依赖关系写入了pom.xml文件中,我们因为只是新建一个简单的项目,所以就只选择web即可~然后点next,再点击finish即可

springboot学习(一)--创建springboot项目

左边是我们项目的结构,右下角是正在下载项目所需jar包

springboot学习(一)--创建springboot项目

这个类就是我们项目的入口,而@SpringBootApplication这个注解是一个复合注解,使用这个注解相当于使用了@Configuration @EnableAutoConfiguration @ComponentScan 这三个注解

现在我们可以先写一个controller,当然,内容还是helloWorld,demo必备

springboot学习(一)--创建springboot项目

现在我们就可以试试启动项目,访问这个controller了,看看会不会报错

springboot学习(一)--创建springboot项目

好了,项目正常启动,在浏览器输入地址:http://localhost:8080/helloWorld

springboot学习(一)--创建springboot项目

成功将我们controller中的内容返回到屏幕上了



相关文章:

  • 2021-12-13
  • 2021-11-17
  • 2021-11-29
  • 2021-08-07
  • 2021-07-15
  • 2022-01-08
  • 2021-06-17
  • 2021-10-28
猜你喜欢
  • 2021-08-18
  • 2021-10-23
  • 2021-11-09
  • 2021-07-30
  • 2021-08-12
  • 2021-05-29
相关资源
相似解决方案