【问题标题】:Are there naming recommendations for spring boot starters with more complex names?对于名称更复杂的 Spring Boot Starter,是否有命名建议?
【发布时间】:2018-12-03 16:50:17
【问题描述】:

Spring Boot documentation 说明了如何为具有简单名称(例如 acme)的东西命名 Spring Boot 启动器:acme-spring-boot-starter

但是,自动配置的“事物”并不总是这么简单的名称。有多个部分的名字怎么样?

例如,CXF 围绕基本名称“拆分”这些部分以表示项目组件层次结构:

  • cxf-spring-boot-starter-jaxws
  • cxf-spring-boot-starter-jaxrs

我发现了具有这些命名模式的其他变体

  • foo-bar-spring-boot-starter
  • spring-boot-starter-foo-bar(可能与 Spring Boot 项目的 starter 冲突,可能不行)

是否有命名约定或建议?

【问题讨论】:

    标签: spring-boot naming-conventions spring-boot-starter


    【解决方案1】:

    https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-custom-starter

    后缀应该是 -spring-boot-starter 所以在你的情况下我会说:

    • cxf-jaxws-spring-boot-starter
    • cxf-jaxrs-spring-boot-starter

    【讨论】:

    • 可悲的是 Spring 本身似乎并没有遵循它的约定,例如spring-cloud-starter-netflix 功能区。出于某种原因,他们似乎已切换到 spring-cloud-starter-xyz。为春云
    猜你喜欢
    • 2022-07-30
    • 1970-01-01
    • 1970-01-01
    • 2019-04-06
    • 2021-10-02
    • 1970-01-01
    • 2016-12-02
    • 2014-04-07
    • 1970-01-01
    相关资源
    最近更新 更多