Integrate Protocol Buffers into Maven2 build

前端 未结 9 769
悲哀的现实
悲哀的现实 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 02:57

    You'll find some information about the plugin available in the Protocol Buffers repository in the Protocol Buffers Compiler Maven Plug-In thread on the Protocol Buffers discussion group. My understanding is that it's usable but lacking tests. I'd give it a try.

    Or you could just use the antrun plugin (snipet pasted from the thread mentioned above):

     
       
         
           maven-antrun-plugin
           
             
               generate-sources
               generate-sources
               
                 
                   
                   
                     
                     
                   
                 
                 target/generated-sources
               
               
                 run
               
             
           
         
       
     
    
     
       
         com.google.protobuf
         protobuf-java
         2.0.3
       
     
    

提交回复
热议问题