java-chassis 提供的spring boot starter说明

java-chassis提供了spring-boot-starter,方便在spring boot中集成java-chassis。由于早期命名没考虑规范性,在使用这些starter之前,需要注意区分使用的java-chassis版本和spring boot版本。

java-chassis 2.0.0 以上 + spring boot 2.0以上 例子

  • java-chassis-spring-boot-starter-standalone

“JAVA应用方式”使用。

POM依赖:

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.servicecomb</groupId>
  4. <artifactId>java-chassis-spring-boot-starter-standalone</artifactId>
  5. </dependency>
  6. </dependencies>
  • java-chassis-spring-boot-starter-servlet

“Web开发方式”使用。

POM依赖:

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.servicecomb</groupId>
  4. <artifactId>java-chassis-spring-boot-starter-servlet</artifactId>
  5. </dependency>
  6. </dependencies>

两种方式的dependency management配置如下:

  1. <dependencyManagement>
  2. <dependencies>
  3. <dependency>
  4. <groupId>org.apache.servicecomb</groupId>
  5. <artifactId>java-chassis-dependencies</artifactId>
  6. <version>2.0.0-SNAPSHOT</version>
  7. <type>pom</type>
  8. <scope>import</scope>
  9. </dependency>
  10. </dependencies>
  11. </dependencyManagement>

java-chassis 1.3.x + spring boot 2.0 例子

  • spring-boot2-starter-standalone

“JAVA应用方式”使用。

POM依赖:

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.servicecomb</groupId>
  4. <artifactId>spring-boot2-starter-standalone</artifactId>
  5. </dependency>
  6. </dependencies>
  • spring-boot2-starter-servlet

“Web开发方式”使用。

POM依赖:

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.servicecomb</groupId>
  4. <artifactId>spring-boot2-starter-servlet</artifactId>
  5. </dependency>
  6. </dependencies>

两种方式的dependency management配置如下:

  1. <dependencyManagement>
  2. <dependencies>
  3. <dependency>
  4. <groupId>org.apache.servicecomb</groupId>
  5. <artifactId>java-chassis-dependencies-springboot2</artifactId>
  6. <version>1.3.0</version>
  7. <type>pom</type>
  8. <scope>import</scope>
  9. </dependency>
  10. </dependencies>
  11. </dependencyManagement>

java-chassis 1.3.x + spring boot 1.0 例子

  • spring-boot-starter-provider

“JAVA应用方式”使用。

POM依赖:

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.servicecomb</groupId>
  4. <artifactId>spring-boot-starter-provider</artifactId>
  5. </dependency>
  6. </dependencies>
  • spring-boot-starter-transport

“Web开发方式”使用。

POM依赖:

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.servicecomb</groupId>
  4. <artifactId>spring-boot-starter-transport</artifactId>
  5. </dependency>
  6. </dependencies>

两种方式的dependency management配置如下:

  1. <dependencyManagement>
  2. <dependencies>
  3. <dependency>
  4. <groupId>org.apache.servicecomb</groupId>
  5. <artifactId>java-chassis-dependencies-springboot1</artifactId>
  6. <version>1.3.0</version>
  7. <type>pom</type>
  8. <scope>import</scope>
  9. </dependency>
  10. <!-- spring boot 1.5.14.RELEASE use a low version of validation-api, must override it -->
  11. <dependency>
  12. <groupId>javax.validation</groupId>
  13. <artifactId>validation-api</artifactId>
  14. <version>2.0.0.Final</version>
  15. </dependency>
  16. </dependencies>
  17. </dependencyManagement>