protobuf-maven-plugin | Protobuf Maven Plugin | Plugin library
kandi X-RAY | protobuf-maven-plugin Summary
kandi X-RAY | protobuf-maven-plugin Summary
There are a couple of plugins out there to compile Google Protobuf files, but most of them end up giving NPEs, so you have to fallback to Exec Plugin. That's why I wanted to create a quite simple plugin that just does the job. Plus the source code is very small and simple to fix any possible issue.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Executes the protoc command
- Compile proto files
- Creates the command
- Detect protobuf version
- Process a file
- This method traverses the given dependency
- Validates the protocol version validation strategy
- Returns the protocol version
- Determine if the given library version is valid
- Populate include directories
- Prints the error stream and exits
- Return the protoc version command
- Returns true if the name ends with the given extension
protobuf-maven-plugin Key Features
protobuf-maven-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on protobuf-maven-plugin
QUESTION
I'm trying to configure mail service in simple spring boot app to send email notifications.
Here is my config:
...ANSWER
Answered 2021-Dec-13 at 07:33I guess your config is not correct. Instead of
QUESTION
I have a pom file that correctly generates the grpc and protobuf source files I need in target/generated-sources when run from the command line. But when I build in vscode those directories are empty and references to the protobufs are undefined. Here's the section of my pom file that builds the grpc source.
...ANSWER
Answered 2021-Aug-09 at 09:56Use protoc-jar-maven-plugin
instead.
Sample usage please view protoc-jar-maven-plugin.
QUESTION
My Java Grpc proto project is building fine locally on a Windows PC but the build is failing on a Linux PC with below error. Any one has any info on this error? I appreciate your suggestions.
[ERROR] PROTOC FAILED: ERROR] /mycompany/home/jenkins/workspace/myproject/src/main/proto/myvalidation.proto [0:0]:/mycompany/home/jenkins/workspace/myproject/target/protoc-plugins/protoc-3.15.8-linux-x86_64.exe: symbol lookup error: /mycompany/home/jenkins/workspace/myproject/target/protoc-plugins/protoc-3.15.8-linux-x86_64.exe: undefined symbol: _ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE [ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project myproject: protoc did not exit cleanly.
I am trying to write custom validation and used below project as reference https://github.com/entur/protobuf-validation
Here is the build snippet of my pom.xml
:
ANSWER
Answered 2021-Jul-06 at 14:22The error you are seeing is not from the Protoc
executable itself. The "symbol lookup error (undefined symbol)" means that a linked library could not be found. Most likely Protoc
is linked against a symbol used in a newer library than the one you have installed. In this case, referring to the symbol _ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE
, it seems to be an issue with the shared GNU C Library (e.g. glibc).
In your newest edit you shared that you are using glibc 2.5 which was released around 15 years ago. I strongly suggest that you install a newer version of glibc. Most likely your operating system is also in dire need of an upgrade.
QUESTION
I've created a simple test gRPC server(Java, Spring) to test the technology.
When trying to call a function from the server I am getting an error { "error": "2 UNKNOWN: Stream removed" }
Inside the application, no stack trace is printed, I can't catch the program execution using breakpoint invisible for me code
...ANSWER
Answered 2021-Mar-25 at 10:35I can't explain the real root of the problem but the thing that helped me is providing different ports for the server and gRPC, hope it will help someone
QUESTION
I was trying to build a grpc service using the following plugin. Seems like the plugin is not able to use protoc utility.
OS : MAC
Maven version : 3.6.3
Error :
...ANSWER
Answered 2021-Jan-24 at 17:22You are missing the protobuf-java
dependency.
QUESTION
I'm following this tutorial for GRPC, my problem is that when I run "mvn protobuf:compile" the files are getting generated in the target folder, I'm not sure how to generate the code to the java dir, here is my POM file
...ANSWER
Answered 2020-Nov-22 at 08:56Generated sources are not really that useful unless you want to distribute your code as a library with source code available. Generated classes are more than enough to work with GRPC. And project builds faster.
protobuf-maven-plugin
can be configured to use path of your choice for generated classes via outputDirectory
in plugin configuration section.
Just don't put them into your sources folder.
protobuf:compile
will get you only protobuf definitions.
To get grpc stubs you need compile-custom
goal as configured in the build.
Usually there's no need to invoke them separately, just compile the whole project and you're fine.
QUESTION
trying to submit job to dataflow via java -jar target/assembly.jar but failing with error below, but with direct runner it's working fine.
...ANSWER
Answered 2020-Nov-04 at 04:48I believe this issue can happen when the generated jar doesn't include some service implementations in META-INFO/services. Please try the following maven-shade-plugin
instead of maven-assembly-plugin
for packaging.
I found the plugin configuration in pom.xml generated from Beam Quickstart .
QUESTION
I am trying to compile a Maven project named web-server which is dependent on search-client within the specified dependency version range [2.0,3.0). The compile fails however due to a "No versions available for > com.test.search:search-client:jar:[2.0,3.0) within specified range" in the repository.
These are the steps I am following:
- Make my changes and build search-client locally
This builds a 2.0-SNAPSHOT jar for this client pom in my local m2 repository.
- Try to build web-server which is dependent on the above
This does not compile giving the following error:
[ERROR] Failed to execute goal on project common: Could not resolve dependencies for project com.test.web:common:jar:2.0-SNAPSHOT: Failed to collect dependencies at com.test.search:search-client:jar:[2.0,3.0): No versions available for com.test.search:search-client:jar:[2.0,3.0) within specified range -> [Help 1]
Web Server POM:
...ANSWER
Answered 2020-Aug-09 at 22:42According to POM Reference, Version Order Specification:
"
1-snapshot
" < "1
" < "1-sp
" (qualifier padding)
2.0-SNAPSHOT
is less than 2.0
, which always was in Maven: snapshot versions are the pre-versions of the next release version.
So, no, 2.0-SNAPSHOT
does not lie in [2.0,3.0)
(2.0 <= x < 3.0). (1,3.0)
(1 < x < 3.0) should do it.
And, there's a typo in your Web Server POM:
QUESTION
I'm new to gRpc, I'm trying to use it between a Java 11(Spring Boot 2) server and a Java 8 (Spring Boot 1.5) client using gRpc 1.27.1 and protobuf 3.11.
Here is my setup:
I have data model library with just 1 proto definition file and maven files to generate java source code that is shared between the client and the server
The relevant parts of the pom.xml
:
ANSWER
Answered 2020-Mar-27 at 19:52It turns out that I had not posted my server code and that is where the problem was.
I'll post my mistake here so that no one else has to spent time with this silly mistake:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install protobuf-maven-plugin
You can use protobuf-maven-plugin like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the protobuf-maven-plugin component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page