Skip to content
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

Improve server getting-started docs #479

Merged
merged 4 commits into from Jan 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 35 additions & 13 deletions docs/en/server/getting-started.md
Expand Up @@ -44,19 +44,29 @@ We recommend splitting your project into 2-3 separate modules.
#### Maven (Interface)

````xml
<properties>
<protobuf.version>3.14.0</protobuf.version>
<protobuf-plugin.version>0.6.1</protobuf-plugin.version>
<grpc.version>1.35.0</grpc.version>
</properties>

<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<!-- Java 9+ compatibility -->
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<!-- Java 9+ compatibility - Do NOT update to 2.0.0 -->
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
<optional>true</optional>
</dependency>
</dependencies>

Expand All @@ -65,13 +75,15 @@ We recommend splitting your project into 2-3 separate modules.
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.6.2</version>
</extension>
</extensions>

<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-plugin.version}</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
Expand All @@ -93,11 +105,27 @@ We recommend splitting your project into 2-3 separate modules.
#### Gradle (Interface)

````gradle
apply plugin: 'com.google.protobuf'
buildscript {
ext {
protobufVersion = '3.14.0'
protobufPluginVersion = '0.8.14'
grpcVersion = '1.35.0'
}
}

plugins {
id 'java-library'
id 'com.google.protobuf' version "${protobufPluginVersion}"
}

repositories {
mavenCentral()
}

dependencies {
compile "io.grpc:grpc-protobuf"
compile "io.grpc:grpc-stub"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
compileOnly 'jakarta.annotation:jakarta.annotation-api:1.3.5' // Java 9+ compatibility - Do NOT update to 2.0.0
}

protobuf {
Expand All @@ -110,7 +138,7 @@ protobuf {
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java"
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
Expand All @@ -120,12 +148,6 @@ protobuf {
}
}

buildscript {
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:${protobufGradlePluginVersion}"
}
}

// Optional
eclipse {
classpath {
Expand Down