资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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之依赖-创新互联
当前地址:http://cdkjz.cn/article/ddishs.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220