idea 创建springboot项目

1. 打开idea选择如下,next

idea 创建springboot项目_第1张图片

2. 确定目录结构

idea 创建springboot项目_第2张图片

3. 选择依赖,next,finish

idea 创建springboot项目_第3张图片
初始化需要一会

4. pox.xml依赖




    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.2.2.RELEASE
         
    
    com.lili
    springboot
    0.0.1-SNAPSHOT
    springboot
    Demo project for Spring Boot

    
        1.8
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            1.3.2
        
        
            org.apache.commons
            commons-lang3
            3.4
        
        
            com.github.pagehelper
            pagehelper-spring-boot-starter
            1.2.5
        
        
        
            com.alibaba
            druid-spring-boot-starter
            1.1.9
        
        
        
            mysql
            mysql-connector-java
            5.1.47
            runtime
        
        
        
            org.projectlombok
            lombok
            true
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
            
                
                    org.junit.vintage
                    junit-vintage-engine
                
            
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
            
            
                org.mybatis.generator
                mybatis-generator-maven-plugin
                1.3.2
                
                    ${basedir}/src/main/resources/generator/generatorConfig.xml
                    true
                    true
                
            
        
    

5. application.yml ( .properties是以键值对形式)

server:
  port: 8880
spring:
  datasource:
    name: controller
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      filters: stat
      driver-class-name: com.mysql.jdbc.Driver
      url: jdbc:mysql://localhost/controller?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
      username: root
      password: root

      initial-size: 1
      min-idle: 1
      max-active: 20

      max-wait: 60000

      time-between-eviction-runs-millis: 60000

      min-evictable-idle-time-millis: 300000
      validation-query: SELECT 'x'
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false

      pool-prepared-statements: false
      max-pool-prepared-statement-per-connection-size: 20

mybatis:
  mapper-locations: classpath:com/lili/dao/mapper/*.xml
  type-aliases-package: com.lili.entity

#pagehelper
pagehelper:
  helperDialect: mysql
  reasonable: true
  supportMethodsArguments: true
  params: count=countSql
  returnPageInfo: check

5.目录结构如下 resource中mapper路径要是“/”:com/xxx/dao/mapper

idea 创建springboot项目_第4张图片

6. generatorConfig.xml

```

PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">































```

你可能感兴趣的:(idea 创建springboot项目)