Is it possible to override executions in maven pluginManagement?

前端 未结 1 518
深忆病人
深忆病人 2020-12-17 18:25

In parent POM, I have:

 
            
                maven-resources-plugin
              


        
1条回答
  •  醉梦人生
    2020-12-17 18:27

    A quick option is to use none when overriding each execution. So for example to run execution 3 only you would do the following in your pom:

    
      
        
            maven-resources-plugin
            2.5
            
                
                    execution 1
                    none
                    ...
                
                
                    execution 2
                    none
                    ...
                
                
                    execution 3
                    ...
                
            
        
        ...
      
      ...
    
    

    It should be noted that this is not an officially documented feature, so support for this could be removed at any time.

    The recommend solution would probably be to define profiles which have activation sections defined:

    
      execution3
      
        
          maven.resources.plugin.execution3
          true
        
      
      ...
    

    The in your sub project you would just set the required properties:

    
        true
    
    

    More details on profile activation can be found here: http://maven.apache.org/settings.html#Activation

    0 讨论(0)
提交回复
热议问题