【idea新建springboot项目】idea快速搭建springboot项目的操作方法

时间:2024-03-24  来源:php应用  阅读:

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

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

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

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

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

建立好的项目结构如下:

相对应的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项目的操作方法

http://m.bbyears.com/jiaocheng/144032.html

推荐访问:idea创建springboot项目 eclipse搭建springboot项目
相关阅读 猜你喜欢
本类排行 本类最新