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

fix: protoPaths as import params to protoc (Maven) #1768

Merged
merged 8 commits into from
Apr 17, 2023
Merged

fix: protoPaths as import params to protoc (Maven) #1768

merged 8 commits into from
Apr 17, 2023

Conversation

sebastian-alfers
Copy link
Contributor

@sebastian-alfers sebastian-alfers commented Apr 12, 2023

When using mvn, pass all items listed within <protoPaths> individually as -I to protoc.

This allows to use protos from an artifact dependency in a maven build, like it is already supported for sbt and gradle.

Todo:

  • Docs

Fixes:


Took inspiration from here and provides a full working example of the workaround described.

@@ -40,10 +46,17 @@ public static CompletionStage<ServerBinding> run(ActorSystem sys) throws Excepti
// Instantiate implementation
GreeterService impl = new GreeterServiceImpl(mat);

// Create the reflection handler for multiple services
Function<HttpRequest, CompletionStage<HttpResponse>> reflectionPartial =
ServerReflection.create(Arrays.asList(GreeterService.description), sys);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, but helped me to test locally.

@@ -217,7 +217,7 @@ jobs:
- name: Test Maven Java
run: |-
cd plugin-tester-java
mvn -Dakka.grpc.project.version=`cat ~/.version` akka-grpc:generate compile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

akka-grpc:generate should not be needed explicitly as it is already run bin compile (otherwise it would fail I assume).

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin good, left some comments

project/Dependencies.scala Outdated Show resolved Hide resolved
project/Dependencies.scala Outdated Show resolved Hide resolved
plugin-tester-java/pom.xml Show resolved Hide resolved
@johanandren johanandren merged commit 8e07c1a into akka:main Apr 17, 2023
@johanandren johanandren added this to the 2.3.1 milestone Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants