zoukankan      html  css  js  c++  java
  • Eclipse对spring-boot,spring-boot-mybatis的搭建

    1.准备工作

    1.1.如果没有sts(spring tool suite)插件,  则需要下载。

    1.1.1.eclipse下载的话,一定要注意版本,因为eclipse会直接下载最新版本,如果ts版本与eclipse的对应不上,则会新建不了springboot工程。help--> Eclipse Marketplace,然后选择Popular,选择sts,点击install。(注意:下载之前,maven的镜像文件调整为aliyun的)。

    下载完毕之后,如果版本不对,则需要更新:Help-->Install New Software-->work with 中输入:http://dist.springsource.com/release/TOOLS/update/e4.6/

    注意:e4.6是我的eclipse的版本,查看eclipse版本:help-->About eclipse,然后点击eclipse图标(一般来说都是第一个),找到Featrue name下的Eclipses Platform 查看版本。

    1.2.也可以在这里选择下载:https://spring.io/tools/sts/legacy,安装自行度娘。

    2.新建sprint boot 

    2.1.new-->other-->spring boot,选择spring stater project,根据需要填写,在next之后,选择web,选择sql

    ,然后选择数据库,我的是mysql,我要整合mybatis,所以也点了mybastis。(如若只点击web,就会成功的新建了spring boot)

    2.2.新建完成后,会自行下jar包,如果maven版本太低,则pom会报一个org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)错误。解决方案是:

      在help --> Install New Software > Work with中输入如下,

    https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/,
    然后回车,等待,安装完毕后重启即可。

    配置数据库连接:

    spring.datasource.url=jdbc:mysql://localhost:3306/数据库名字
    spring.datasource.username=pass
    spring.datasource.password=密码
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver

    #配置maper映射文件,在resource下的mapper文件下
    mybatis.mapper-locations= classpath:mapper/*.xml



  • 相关阅读:
    eclipse下c/cpp " undefined reference to " or "launch failed binary not found"问题
    blockdev 设置文件预读大小
    宝宝语录
    CentOS修改主机名(hostname)
    subprocess报No such file or directory
    用ldap方式访问AD域的的错误解释
    英特尔的VTd技术是什么?
    This virtual machine requires the VMware keyboard support driver which is not installed
    Linux内核的文件预读详细详解
    UNP总结 Chapter 26~29 线程、IP选项、原始套接字、数据链路访问
  • 原文地址:https://www.cnblogs.com/hsz-csy/p/8976894.html
Copyright © 2011-2022 走看看