idea中怎么搭建springboot项目

您所在的位置:网站首页 idea中的src是什么 idea中怎么搭建springboot项目

idea中怎么搭建springboot项目

2023-05-19 20:32| 来源: 网络整理| 查看: 265

Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程。它主要推崇的是'消灭配置',实现零配置。

那么,如何在idea中创建一个springboot项目呢?

一.在你建立的工程下创建 Module 选择Spring initializr创建。

idea中怎么搭建springboot项目

二.在Type处选择: Maven Project(项目的构建工具)

idea中怎么搭建springboot项目

三.创建依赖时勾上web,mybatis,mysql(这个看你个人需要吧,可以自主选择)

idea中怎么搭建springboot项目

idea中怎么搭建springboot项目

建立好的项目结构如下:

idea中怎么搭建springboot项目

相对应的pom.xml文件

4.0.0 com demo 0.0.1-SNAPSHOT jar demo Demo project for Spring Boot org.springframework.boot spring-boot-starter-parent 1.5.9.RELEASE UTF-8 UTF-8 1.8 org.mybatis.spring.boot mybatis-spring-boot-starter 1.3.1 org.springframework.boot spring-boot-starter-web mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-test test com.mchange c3p0 0.9.5.2 org.springframework.boot spring-boot-maven-plugin 登录后复制

application.yml(项目建城时这个application文件的后缀名不叫yml,是官方推荐把后缀改成yml的,好处是代码有提示)

mybatis: mapper-locations: classpath:mapper/*.xml type-aliases-package: com.demo.pojo #数据库连接池 spring: datasource: username: root password: sasa url: jdbc:mysql://localhost:3306/ssm driver-class-name: com.mysql.jdbc.Driver登录后复制

启动

idea中怎么搭建springboot项目

以上就是idea中怎么搭建springboot项目的详细内容,更多请关注php中文网其它相关文章!



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3