diff --git a/core/deployment/src/main/java/io/quarkus/deployment/CodeGenProvider.java b/core/deployment/src/main/java/io/quarkus/deployment/CodeGenProvider.java index 7974c580e6df0..04bdfbfb56d2d 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/CodeGenProvider.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/CodeGenProvider.java @@ -16,9 +16,9 @@ public interface CodeGenProvider { String providerId(); /** - * File extensions that CodeGenProvider will generate code from + * File extension that CodeGenProvider will generate code from * - * @return collection of file extensions + * @return file extension */ @NotNull String inputExtension(); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java b/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java index 19472275f002e..5b7ce4af881fb 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java @@ -13,6 +13,9 @@ import io.quarkus.bootstrap.prebuild.CodeGenException; import io.quarkus.deployment.codegen.CodeGenData; +/** + * A set of methods to initialize and execute {@link CodeGenProvider}s. + */ public class CodeGenerator { // used by Gradle diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusPrepare.java b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusPrepare.java index 0e8c61e573215..ec1c4fd1e01e1 100644 --- a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusPrepare.java +++ b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusPrepare.java @@ -33,7 +33,7 @@ public class QuarkusPrepare extends QuarkusTask { private boolean test = false; public QuarkusPrepare() { - super("Quarkus performs pre-build preparations, such as sources generation"); + super("Performs Quarkus pre-build preparations, such as sources generation"); } @TaskAction diff --git a/devtools/maven/src/main/java/io/quarkus/maven/CodeGenMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/CodeGenMojo.java index 67f546f2171af..dc812e5b6131e 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/CodeGenMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/CodeGenMojo.java @@ -33,7 +33,7 @@ import io.quarkus.deployment.CodeGenerator; import io.quarkus.deployment.codegen.CodeGenData; -@Mojo(name = "prepare", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME) +@Mojo(name = "prepare", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, threadSafe = true) public class CodeGenMojo extends AbstractMojo { @Parameter(defaultValue = "${project.build.directory}") diff --git a/docs/src/main/asciidoc/grpc-getting-started.adoc b/docs/src/main/asciidoc/grpc-getting-started.adoc index ac4fb5ad7ff44..ae0ed1717d720 100644 --- a/docs/src/main/asciidoc/grpc-getting-started.adoc +++ b/docs/src/main/asciidoc/grpc-getting-started.adoc @@ -15,6 +15,16 @@ The default configuration is enough, but you can also select some extensions if == Configuring your project +Edit the `pom.xml` file to add the Quarkus gRPC extension dependency (just under ``): + +[source,xml] +---- + + io.quarkus + quarkus-grpc + +---- + Make sure you have `prepare` goal of `quarkus-maven-plugin` enabled in your `pom.xml`: [source,xml] @@ -39,7 +49,7 @@ Make sure you have `prepare` goal of `quarkus-maven-plugin` enabled in your `pom With this configuration, you can put your service and message definitions in the `src/main/proto` directory. `quarkus-maven-plugin` will generate Java files from your `proto` files. -Alternatively, you can use `protobuf-maven-plugin` to generate these files, more in <> +Alternatively to using the `prepare` goal of the `quarkus-maven-plugin`, you can use `protobuf-maven-plugin` to generate these files, more in <> Let's start with a simple _Hello_ service. Create the `src/main/proto/helloworld.proto` file with the following content: @@ -258,18 +268,9 @@ You can also package the application into a native executable with: `mvn package == Generating Java files from proto with protobuf-maven-plugin Alternatively to using Quarkus code generation to generate stubs for `proto` files, you can also use -`protobuf-maven-plugin` for this purpose. -To do it, edit the `pom.xml` file to add the quarkus gRPC extension dependency and the JSR 305 (just under ``): - -[source,xml] ----- - - io.quarkus - quarkus-grpc - ----- +`protobuf-maven-plugin`. -In the `` section, define the 2 following properties: +To do it, first define the 2 following properties in the `` section: [source,xml,subs="verbatim,attributes"] ---- @@ -279,7 +280,7 @@ In the `` section, define the 2 following properties: They configure the gRPC version and the `protoc` version. -Finally, add to the `build` section the `os-maven-plugin` extension and the `protobuf-maven-plugin` configuration. +Then, add to the `build` section the `os-maven-plugin` extension and the `protobuf-maven-plugin` configuration. [source,xml,subs="verbatim,attributes"] ----