Automatically generate Java from .proto with maven/m2e in Eclipse IDE

后端 未结 3 1590
北荒
北荒 2020-12-13 15:55

For my team, I\'d like to configure maven/eclipse build to automatically generate Java code from *.proto files (in a project that uses gRPC). Currently one need

3条回答
  •  旧巷少年郎
    2020-12-13 16:54

    Both eclipse and vscode can automatically compile proto when changed.

                
                    kr.motd.maven
                    os-maven-plugin
                    1.6.2
                    
                        
                            initialize
                            
                                detect
                            
                        
                    
                
                
                    org.xolstice.maven.plugins
                    protobuf-maven-plugin
                    0.6.1
                    
                        com.google.protobuf:protoc:3.12.0:exe:${os.detected.classifier}
                        grpc-java
                        io.grpc:protoc-gen-grpc-java:1.32.1:exe:${os.detected.classifier}
                    
                    
                        
                            
                                compile
                                compile-custom
                            
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    3.8.1
                    
                        8
                        8
                        UTF-8
                    
                
    

提交回复
热议问题