Integrate Protocol Buffers into Maven2 build

前端 未结 9 691
悲哀的现实
悲哀的现实 2021-01-30 02:18

I\'m experimenting with Protocol Buffers in an existing, fairly vanilla Maven 2 project. Currently, I invoke a shell script every time I need to update my generated sources. Thi

9条回答
  •  逝去的感伤
    2021-01-30 03:15

    The accepted solution does not scale for multiple proto files. I had to come up with my own:

    
        
            
                maven-antrun-plugin
                
                    
                        compile-protoc
                        generate-sources
                        
                            
                                
                                
                                    
                                        
                                    
                                
                                
                                
                                    
                                    
                                    
                                
                            
                        
                        
                            run
                        
                    
                
            
    
    

提交回复
热议问题