# protoc-jar-maven-plugin **Repository Path**: shamphone/protoc-jar-maven-plugin ## Basic Information - **Project Name**: protoc-jar-maven-plugin - **Description**: Protocol Buffers protobuf maven plugin - based on protoc-jar multi-platform executable protoc JAR - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-16 - **Last Updated**: 2021-06-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README protoc-jar-maven-plugin ======================= Protocol Buffers protobuf maven plugin - performs protobuf code generation using [protoc-jar](https://github.com/os72/protoc-jar) multi-platform executable protoc JAR. Available on Maven Central: http://central.maven.org/maven2/com/github/os72/protoc-jar-maven-plugin/3.5.1.1/ [![Maven Central](https://img.shields.io/badge/maven%20central-3.5.1.1-brightgreen.svg)](http://search.maven.org/#artifactdetails|com.github.os72|protoc-jar-maven-plugin|3.5.1.1|) Simple maven plugin to compile .proto files using [protoc-jar](https://github.com/os72/protoc-jar) embedded protoc compiler, providing some portability across the major platforms (Linux, Mac/OSX, and Windows). At build time the plugin detects the platform and executes the corresponding protoc binary. Supports protoc versions 2.4.1, 2.5.0, 2.6.1, 3.5.1. Also supports pre-installed protoc binary, and downloading binaries (protoc and protoc plugins) from maven repo * New: Support for Linux on POWER8 platform (linux-ppcle_64), thanks to [Apache SystemML](https://github.com/apache/systemml) folks ([nakul02](https://github.com/nakul02)) * New: Support for FreeBSD on x86 platform (freebsd-x86_64), thanks [kjopek](https://github.com/kjopek) * New: Support for Linux on ARM platform (linux-aarch_64; 2.4.1, 2.6.1, 3.4.0), thanks [garciagorka](https://github.com/garciagorka) See also * https://github.com/os72/protoc-jar * https://github.com/os72/protobuf-java-shaded-241 * https://github.com/os72/protobuf-java-shaded-250 * https://github.com/os72/protobuf-java-shaded-261 * https://github.com/os72/protobuf-java-shaded-351 * https://github.com/google/protobuf Binaries * http://central.maven.org/maven2/com/google/protobuf/protoc/ * http://central.maven.org/maven2/com/github/os72/protoc/ * https://oss.sonatype.org/content/repositories/snapshots/com/github/os72/protoc/ #### Usage Documentation: see http://os72.github.io/protoc-jar-maven-plugin/, in particular [run-mojo](http://os72.github.io/protoc-jar-maven-plugin/run-mojo.html) Sample usage - compile in main cycle into `target/generated-sources`, add generated sources to project, use default `protoc` version and default `src/main/protobuf` source folder: ```xml com.github.os72 protoc-jar-maven-plugin 3.5.1.1 generate-sources run ``` Sample usage - compile in main cycle into `target/generated-sources`, add generated sources to project, add all .proto sources to generated jar, include `google.protobuf` standard types, include additional imports: ```xml com.github.os72 protoc-jar-maven-plugin 3.5.1.1 generate-sources run all true src/main/more_proto_imports src/main/protobuf ``` Sample usage - download protoc and plugin binaries from maven repo, multiple output targets (example: gRPC): ```xml com.github.os72 protoc-jar-maven-plugin 3.5.1.1 generate-sources run com.google.protobuf:protoc:3.0.0 src/main/resources java grpc-java io.grpc:protoc-gen-grpc-java:1.0.1 ``` Sample usage - compile in test cycle, multiple output targets, don't alter project (`: none`): ```xml com.github.os72 protoc-jar-maven-plugin 3.5.1.1 generate-test-sources run 2.4.1 src/test/resources java none src/test/java descriptor none src/test/resources ``` Sample usage - generate java shaded for use with `protobuf-java-shaded-241`, don't alter project: ```xml com.github.os72 protoc-jar-maven-plugin 3.5.1.1 generate-sources run 2.4.1 java-shaded none src/main/java src/main/protobuf ``` #### Credits Originally based on * https://github.com/igor-petruk/protobuf-maven-plugin