spring-boot结合mysql整合mybatis

环境及工具:
  系统:Mac 10.12.6  
  JDK版本: 1.8
  maven 版本:3.0
  开发工具:eclipse 
  数据库:mysql
  语言:java

打开eclipse的Marketplace(Help—>Marketplace),安装spring-boot的工具环境。

如何确认安装完成呢?如下即可(新建项目可以看到spring start等选项):


接下来就创建项目,创建的时候可以任何jar依赖都不选择,我们可以自己向pom文件中添加,创建后的文件结构如下(已经删除了两个mvn文件):


接下来就是添加pom了,这是我的pom.xml
<? xml   version = "1.0"   encoding = "UTF-8" ?>
< project   xmlns = "http://maven.apache.org/POM/4.0.0"   xmlns:xsi =   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
     < modelVersion > 4.0.0 </ modelVersion >
     < groupId > com.example </ groupId >
     < artifactId > demo-boot </ artifactId >
     < version > 0.0.1-SNAPSHOT </ version >
     < packaging > jar </ packaging >
     < name > demo-boot </ name >
     < description > Demo project for Spring Boot </ description >
     < parent >
          < groupId > org.springframework.boot </ groupId >
          < artifactId > spring-boot-starter-parent </ artifactId >
          < version > 1.4.1.RELEASE </ version >
     </ parent >
     < properties >
          < project. build. sourceEncoding > UTF-8 </ project. build. sourceEncoding >
          < project. reporting. outputEncoding > UTF-8 </ project. reporting. outputEncoding >
          < java. version > 1.8 </ java. version >
          < mysql-connector. version > 5.1.21 </ mysql-connector. version >
     </ properties >
     < dependencies >
          <!-- aop  -->
          < dependency >
               < groupId > org.springframework.boot </ groupId >
               < artifactId > spring-boot-starter-aop </ artifactId >
          </ dependency >
          <!-- cache  -->
          < dependency >
               < groupId > org.springframework.boot </ groupId >
               < artifactId > spring-boot-starter-cache </ artifactId >
          </ dependency >
          <!-- redis  -->
          < dependency >
               < groupId > org.springframework.boot </ groupId >
               < artifactId > spring-boot-starter-redis </ artifactId >
          </ dependency >
          < dependency >
               < groupId > org.springframework.boot </ groupId >
               < artifactId > spring-boot-starter </ artifactId >
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值