protoc-gen-validate
protoc-gen-validate copied to clipboard
How to use PGV validator for Java
Hi,
Was checking options to include gRPC validation in proto file and protoc-gen-validate can add validator method in the generated class and validates the rules mentioned in the proto file.
I have included below plugin in Java Maven project but getting build error. Need help to verify the configuration and just alternates for validating the proto fields.
Build Error: [ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile-custom (protoc-java-pgv) o n project grpc-java: Unable to resolve artifact: Missing: [ERROR] ---------- [ERROR] 1) com.google.protobuf:protoc:exe:windows-x86_64:$3.12.2 [ERROR] [ERROR] Try downloading the file manually from the project website. [ERROR] [ERROR] Then, install it using the command: [ERROR] mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=$3.12.2 -Dclassifier= windows-x86_64 -Dpackaging=exe -Dfile=/path/to/file [ERROR] [ERROR] Alternatively, if you host your own repository you can deploy the file there: [ERROR] mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=$3.12.2 -Dclassifier=wi ndows-x86_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] [ERROR] [ERROR] Path to dependency: [ERROR] 1) org.examples.grpc.java:grpc-java:jar:1.0-SNAPSHOT [ERROR] 2) com.google.protobuf:protoc:exe:windows-x86_64:$3.12.2 [ERROR] [ERROR] ---------- [ERROR] 1 required artifact is missing. [ERROR] [ERROR] for artifact: [ERROR] org.examples.grpc.java:grpc-java:jar:1.0-SNAPSHOT [ERROR]
Have you been able to resolve? I'm getting similar errors
No i was not able to resolve and couldn't find usage details of this plugin
As explained in the README, this project is in maintenance mode. We recommend upgrading to protovalidate.
I'm going to go ahead and close this issue, but feel free to open one against protovalidate if needed. Thanks!