Maven: how to filter the same resource multiple times with different property values?

后端 未结 4 717
暖寄归人
暖寄归人 2021-02-02 14:12

Our project uses Log4J, configured via log4j.properties file. We have multiple production servers, which log to different log files, so that the logs can be differentiated. So l

4条回答
  •  抹茶落季
    2021-02-02 14:49

    If there are a lot of target configurations that need to be copied, you could use the maven-antrun-plugin together with ant macrodef.

      
        maven-antrun-plugin
        1.3
        
          
            copy-resources-all-nodes
            process-resources
            
              
                 
                    
    
                    
                       
                          
                             
                             
                          
                       
                    
                 
    
                 
                 
                 
                 ...
    
              
            
            
              run
            
          
        
      
    

    If you really have a lot of target configurations, you could also use ant-contrib to iterate over a list of target configurations.

    There's an example how to do this here

提交回复
热议问题