-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add entry for spring-projects-experimental/spring-grpc #1673
Comments
For Gradle, we need to:
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${dependencyManagement.importedProperties['protobuf-java.version']}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${dependencyManagement.importedProperties['grpc.version']}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {
option 'jakarta_omit'
}
}
}
} However, using |
That's not the determining factor. There are other services included (e.g. reflection service that is needed for grpcurl clients). So I would say make it unconditional (and user can opt out later). |
If spring-projects-experimental/spring-grpc#79 is implemented, the Gradle configuration is simplified: protobuf {
protoc {
artifact = 'com.google.protobuf:protoc'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java'
}
}
generateProtoTasks {
all()*.plugins {
grpc {
option 'jakarta_omit'
}
}
}
} |
Here's the Kotlin DSL equivalent: import com.google.protobuf.gradle.id
protobuf {
protoc {
artifact = "com.google.protobuf:protoc"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java"
}
}
generateProtoTasks {
all().forEach { task ->
task.plugins {
id("grpc") {
option("jakarta_omit")
}
}
}
}
} |
For Maven, we would need: Two properties which are used for the
Scope import <dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-dependencies</artifactId>
<version>0.3.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency> Add those dependencies: <dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-test</artifactId>
<scope>test</scope>
</dependency> Add a build extension to get the architecture later needed to download protoc: <build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
// ... Add <plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<configuration>
<pluginParameter>
jakarta_omit
</pluginParameter>
</configuration>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin> Add That would mean that start.spring.io needs to know the versions of those dependencies:
|
Project: https://github.com/spring-projects-experimental/spring-grpc
Maven sample: https://github.com/spring-projects-experimental/spring-grpc/blob/main/samples/grpc-server/pom.xml
Gradle Groovy sample: https://github.com/spring-projects-experimental/spring-grpc/blob/main/samples/grpc-server/build.gradle
The text was updated successfully, but these errors were encountered: