{"id":23550262,"url":"https://github.com/xterna/protobuf-java-artifact","last_synced_at":"2026-01-25T19:04:36.585Z","repository":{"id":221255355,"uuid":"103748698","full_name":"XternA/protobuf-java-artifact","owner":"XternA","description":"Protocol Buffers template ready for creating Java protobuf artifacts.","archived":false,"fork":false,"pushed_at":"2017-09-16T20:18:50.000Z","size":1180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T11:45:59.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Protocol Buffer","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XternA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-09-16T11:58:55.000Z","updated_at":"2017-09-16T20:25:13.000Z","dependencies_parsed_at":"2024-02-07T01:33:27.143Z","dependency_job_id":null,"html_url":"https://github.com/XternA/protobuf-java-artifact","commit_stats":null,"previous_names":["xterna/protobuf-java-artifact"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XternA%2Fprotobuf-java-artifact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XternA%2Fprotobuf-java-artifact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XternA%2Fprotobuf-java-artifact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XternA%2Fprotobuf-java-artifact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XternA","download_url":"https://codeload.github.com/XternA/protobuf-java-artifact/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254359126,"owners_count":22058056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T10:15:12.010Z","updated_at":"2026-01-25T19:04:36.487Z","avatar_url":"https://github.com/XternA.png","language":"Protocol Buffer","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Protobuf Artifact\nProtocol Buffers template ready for creating Java protobuf artifacts. \n\nIdeal for creating Java artifacts which can be distributed as a Maven artifact or segregated for re-use.\n\n# Useful Links\n- Protocol Buffers documentation: https://developers.google.com/protocol-buffers\n- Maven build tool: https://maven.apache.org/download.cgi\n\n# How to use\nDesign how you want your information for serialization to be structured in a `.proto` file and use Maven build tool to construct and build the `.proto` file into a Java artifact.\n\n## 1. Designing your .proto file\nThere is the template `.proto` file located under `src/main/proto`. Here you can create one or many `.proto` files. The end result will bundle all the `.proto` files into one Java artifact when built.\n\nBe sure to modify the `java_package` and `java_outter_classname` to the desired package and outter class name.\n```java\nsyntax = \"proto3\";\n\npackage proto;\n\noption java_package = \"com.protobuf\";\noption java_outer_classname = \"ProtobufTemplate\";\noption java_generic_services = false;\noption java_multiple_files = false;\n```\n\nDocumentation and more on designing of the `.proto` file can be found in the useful link section.\n\n### 2. Changes to make before building with Maven\nMake the following changes to specify your artifact properties by changing the defaults.\n```xml\n\u003cgroupId\u003ecom.protobuf\u003c/groupId\u003e\n\u003cartifactId\u003eprotobuf-template\u003c/artifactId\u003e\n\u003cversion\u003e0.0.1-SNAPSHOT\u003c/version\u003e\n\n\u003cname\u003eProtobuf Template\u003c/name\u003e\n```\n\nAlso change the name of the artifact binary name under `\u003cproperties\u003e` section.\n```xml\n\u003cproperties\u003e\n    \u003cartifact.name\u003eprotobuf-template\u003c/artifact.name\u003e\n\u003c/properties\u003e\n```\n\n### 3. Compiling .proto file\nRun `mvn compile` goal to see if your `.proto` file will compile successfully without error.\nIf successful you will get a `.jar` file under the `${project.build.directory}\\target`.\n\nIncorrect syntax or errors in the `.proto` file can be identified when invoking `mvn compile` on the command line.\n```\n[INFO] ------------------------------------------------------------------------\n[INFO] Building Protobuf Template 0.0.1-SNAPSHOT\n[INFO] ------------------------------------------------------------------------\n[INFO]\n[INFO] --- protobuf-maven-plugin:0.5.0:compile (default) @ protobuf-template ---\n[INFO] Compiling 1 proto file(s) to C:\\Workspace\\protobuf-template\\target\\generated-sources\\protobuf\\java\n[ERROR] PROTOC FAILED: ProtobufTemplate.proto:13:13: Expected field name.\n\n[ERROR] C:\\Workspace\\protobuf-template\\src\\main\\proto\\ProtobufTemplate.proto [0:0]: \n        ProtobufTemplate.proto:13:13: Expected field name.\n\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n```\n\n### 4. Producing the Java artifact\nOnce the `.proto` file compiles without any errors then it can be installed locally, pushed onto remote hosting server or included in your project classpath if your project does not use Maven via the following `mvn` goals:\n\n- `mvn package` - Produces the `.jar` file under `${project.build.directory}\\target`.\n- `mvn install` - Installs to local `.m2` folder on your system.\n- `mvn deploy` - Push to remote Maven hosting server. __Note:__ need to be defined in `pom.xml`.\n\nFinally include the Maven artifact into your project's dependencies of your `pom.xml`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxterna%2Fprotobuf-java-artifact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxterna%2Fprotobuf-java-artifact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxterna%2Fprotobuf-java-artifact/lists"}