RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
springboot之依赖

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

专注于为中小企业提供成都做网站、网站设计服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业恩施土家免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了成百上千企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

  • spring-boot-starter-parent
    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.0.RELEASE
        
    

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

  • spring-cloud-dependencies

    
        
            
                org.springframework.cloud
                spring-cloud-dependencies
                ${spring-cloud.version}
                pom
                import
            
        
    

    spring-cloud-dependencies也是一个依赖管理器的pom文件,与spring-boot-starter-parent的作用一样,不同的是spring-cloud-dependencies是对cloud的依赖管理。如:spring-cloud-starter-config、spring-cloud-starter-netflix-eureka-server

  • spring-boot-starter-web

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

    spring-boot-starter-web会自动嵌入tomcat容器。同时,springboot也会根据classpath中的dependency来自动配置。比如:spring-boot-starter-web会自动装配tomcat容器;并且会自动从application.properties中读取web应用的配置,如:server.port;如果application.properties没有配置相关的参数,则采用默认的配置信息,如:8080。

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

        org.springframework.boot
        spring-boot-starter-data-jpa

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

  • spring-cloud-config-server

    
            org.springframework.cloud
            spring-cloud-config-server
    

    spring-cloud-config-server配置中心;

  • spring-cloud-starter-netflix-eureka-server
    
        org.springframework.cloud
        spring-cloud-starter-netflix-eureka-server
    

    spring-cloud-starter-netflix-eureka-server注册中心。是spring cloud的核心架构。

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


本文题目:springboot之依赖
URL链接:http://sczitong.cn/article/ispijg.html