栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot创建项目记录

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot创建项目记录

1.导入依赖dependency

 
        
        
            org.springframework.boot
            spring-boot-starter-thymeleaf
        
        
            org.springframework.boot
            spring-boot-starter-web
        

        
            org.projectlombok
            lombok
            true
        
        
            org.springframework.boot
            spring-boot-starter-test
        
        
        
            org.springframework.boot
            spring-boot-starter-jdbc
        
        
            mysql
            mysql-connector-java
            runtime
        
        
        
        
            com.alibaba
            druid-spring-boot-starter
            1.2.6
        
        
        
        
            log4j
            log4j
            1.2.17
        
        
        
        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            2.2.0
        
        
        
        
            org.springframework.boot
            spring-boot-starter-data-redis
        
        
        
        
            io.lettuce
            lettuce-core
            6.1.4.RELEASE
        

        
        
            com.auth0
            java-jwt
            3.10.3
        

        
        
        
            com.github.pagehelper
            pagehelper-spring-boot-starter
            1.3.1
        

        
        
            org.hibernate.validator
            hibernate-validator
            6.1.5.Final
        

        
        
        
            org.springframework.boot
            spring-boot-devtools
            2.5.5
        

    

    
        
        
            
                src/main/java
                
                    **/*.xml
                
                true
            
        
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                        
                            org.projectlombok
                            lombok
                        
                    
                
            
            
            
                org.mybatis.generator
                mybatis-generator-maven-plugin
                1.3.6
                
                    ${basedir}/src/main/resources/generator/generatorConfig.xml
                    
                    true
                    true
                
                
                    
                    
                        mysql
                        mysql-connector-java
                        5.1.45
                    
                
            
        
    

2.创建application.yml

server:
  port: 8081
#整合mybatis(实体类别名)
mybatis:
  type-aliases-package: com.spring.pojo
  mapper-locations: classpath:mapper/*.xml #mapper路径
  config-location: classpath:mybatis/mybatis-config.xml #配置一些mybatis属性

3.resource目录下创建mapper和mybatis文件夹,mapper放xxmapper,

mybatis下创建mybatis-config.xml文件




	
	
		  
		  
		 
		 
		
	
	

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/315464.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号