Skip to content

Latest commit

 

History

History

grpc-spring-boot-starter-gradle-plugin

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

GRPC Spring boot gradle plugin

1. Features

Bootstraps the project with com.google.protobuf gradle plugin (including grpc protoc plugin) and io.github.lognet:grpc-spring-boot-starter

2. Setup

plugins {
    id 'java'
    id "io.github.lognet.grpc-spring-boot" version '5.1.5'
}

Your project is configured to :

  1. Generate proto and grpc classes for each .proto file under ${sourceSet}/proto folder for all source sets :

    1. src/main/java/proto/*.proto

    2. src/main/test/proto/*.proto

    3. src/main/myCustomSourset/proto/*.proto.

      by applying com.google.protobuf gradle plugin.

  2. All generated source files are added to your project’s source sets (find them under $buildDir/protoGen folder )

  3. io.github.lognet:grpc-spring-boot-starter is added to implementation configuration dependencies.

3. Configure

All settings are optional (have reasonable defaults):

grpcSpringBoot {
    grpcSpringBootStarterVersion.set("X.X.X")// (1)
    grpcVersion.set("X.X.X")//(2)
    protocVersion.set("X.X.X")//(3)
    reactiveFeature.set(ReactiveFeature.REACTOR)//(4)
    reactiveProtocVersion.set("X.X.X")//(5)
}
  1. io.github.lognet:grpc-spring-boot-starter version to use, defaults to the same version as this plugin.

  2. grpc version to use, defaults to the version the io.github.lognet:grpc-spring-boot-starter was compiled with (see version matrix here)

  3. Version of com.google.protobuf:protoc protocol compiler to use (defaults to 3.21.7)

  4. Enables salesforce’s reactive-grpc protoc plugin, defaults to ReactiveFeature.OFF (supports ReactiveFeature.REACTOR and ReactiveFeature.RX)

  5. reactive-grpc version to use, defaults to 1.2.3

The version of com.google.protobuf can be controlled via pluginManagement block :

setting.gradle
pluginManagement {
    plugins {
        id 'com.google.protobuf' version "X.X.X"//(1)
    }
}
  1. Defaults to 0.9.1.

4. License

Apache 2.0