create directory when needed in maven

后端 未结 3 1753
时光取名叫无心
时光取名叫无心 2020-12-05 06:13

I am using maven-exec-plugin to generate java sources of Thrift. It invokes the external Thrift compiler and using -o to specify the output directory, \"target/generated-sou

3条回答
  •  时光说笑
    2020-12-05 07:11

    Instead of the exec plugin, use the antrun plugin to first create the directory and then invoke the thrift compiler.

    
      maven-antrun-plugin
      
        
          generate-sources
          generate-sources
          
            
              
              
                
                
                
                
                
              
            
          
          
            run
          
        
      
    
    

    You may also want to take a look at the maven-thrift-plugin.

提交回复
热议问题