如何从srcjar伪像生成jar文件?

发布于 2025-02-07 05:27:14 字数 772 浏览 1 评论 0原文

我有一些proto文件,我正在使用bazel来构建它们。我正在使用 proto-rules-grpc 构建 bazel的文件。然后,我正在运行bazel build命令。但是最终的伪像是.srcjar

这也是规则我引用:

生成Java Protobuf和grpc srcjar文件

但我希望最终人工制品中的最终伪像.jar 格式。而.srcjar仅包含.java文件。

我能想到的手动过程是从.srcjar tratefact提取RAW JAVA文件,然后使用它们创建.jar文件。但这有点烦人,手动完成所有操作。

有没有任何方法可以在不涉及手动过程的情况下进行操作?

I have some proto files and I am using bazel to build them. I am using proto-rules-grpc to generate the BUILD file for bazel. Then I'm running bazel build command. But the final artefact is in .srcjar.

This also what the rule says and I quote:

Generates a Java protobuf and gRPC srcjar file

But I want the final artefact in .jar format. Whereas .srcjar only contains the .java file.

The manual process I can think of is to extract the raw java file from the .srcjar artefact and then use them to create the .jar file. But this is a bit annoying to do all this manually.

Is there any way to do it without involving the manual process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光磨忆 2025-02-14 05:27:14

使用Java_grpc_library

java_grpc_compile产生.srcjarjava_grpc_library产生.jar

Use java_grpc_library.

java_grpc_compile produces a .srcjar. java_grpc_library produces a .jar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文