spring boot 之依赖

发布时间:2020-03-30 21:47:46 作者:乾坤刀
来源:网络 阅读:9735

spring boot 虽然不强制使用特殊的依赖。但是其提供了一些非常高效的依赖。其中最有如下几个:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
        <relativePath/>
    </parent>

spring-boot-starter-parent这是一个依赖管理器的pom文件。它的作用就是管理boot需要的所有依赖,从而统一各种jar的版本号,避免了版本不一致而出现的问题。所以,引入其他的依赖就可以省略版本号。当然也可以加上指定的版本号,从而取代默认的。

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

spring-boot-starter-data-jpa数据库连接的依赖。

说明:spring boot提供的一系列spring-boot-starter-和spring-cloud-starter-依赖,其实是相关功能依赖的整合,即引入一个start依赖,就引入多个相应的jar。同时需要注意的是,spring boot提供的starter都是spring-boot-starter-和spring-cloud-starter-这样开头的,如果想自定义starter,则命名格式应该是:*-spring-boot-starter.

推荐阅读:
  1. Spring Cloud 入门教程 - Eureka服务注册与发现
  2. [Spring cloud 一步步实现广告系统] 11. 使用Feign实现微服务调用

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

spring boot spring boo

上一篇:mysql 8.0 2059报错

下一篇:12c rac 实例无法启动之磁盘组空间耗尽

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》