Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jprotobuf嵌套对象,多文件导出,嵌套对象定义重复 #198

Closed
dogheadpig opened this issue Jul 20, 2023 · 3 comments
Closed

Comments

@dogheadpig
Copy link

image
image
image
image
image
没有对应 proto文件的import写法

@jhunters
Copy link
Owner

把导出使用的方式发出来一下

@jhunters
Copy link
Owner

可以升级插件版本,支持去重的功能。
jprotobuf-precompile-plugin-2.2.9 jprotobuf-precompile-plugin-1.4.5

@jhunters jhunters closed this as completed Aug 7, 2023
@LucaLq
Copy link

LucaLq commented Mar 14, 2024

可以升级插件版本,支持去重的功能。 jprotobuf-precompile-plugin-2.2.9 jprotobuf-precompile-plugin-1.4.5

@jhunters 你好,你说的去重是这个配置么<cacheBuildResult>true</cacheBuildResult>,我测试了下还是会重复生成。
这是三个pojo类

@ProtobufClass
public class A {
    public C c;
}

@ProtobufClass
public class B {
    public C c;
}

@ProtobufClass
public class C {
    public String s;
}

生成的A.proto如下

syntax="proto3";
//
message A {  
 C c=1;
}
//
message C { 
 string s=1;
}

生成的B.proto如下

syntax="proto3";
//
message B {  
 C c=1;
}
//
message C { 
 string s=1;
}

生成的C.proto如下

syntax="proto3";
//
message C { 
 string s=1;
}

如上,A.proto和B.proto中重复生成了message C。希望生成的A.proto和B.proto是如下的格式,请问有办法实现吗

syntax="proto3";
import "C.proto"
//
message A {  
 C c=1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants