Disabling goals in a maven plugin execution

前端 未结 1 1557
星月不相逢
星月不相逢 2021-01-06 02:46

I have a setup where most of my projects require the xtend plugin to be run both for the compile and testCompile goals. I describe it in a pluginManagement section:

1条回答
  •  一向
    一向 (楼主)
    2021-01-06 02:50

    Generally, you can only disables executions with a trick:

    Set the executions phase to non existant phase (dont-execute). Note however, that you have to use two different execution ids to allow both goals to be individually turned off:

    
        org.eclipse.xtend
        xtend-maven-plugin
        2.5.3
        
            
                xtend-compile
                
                    compile
                    testCompile
                
            
            
                xtend-testCompile
                
                    testCompile
                
            
        
    
    

    Submodule:

    
        org.eclipse.xtend
        xtend-maven-plugin
        2.5.3
        
            
                xtend-testCompile
                dont-execute
            
        
    
    

    In your specific case, you could, of course, also use the skipXtend configuration property in each execution to not skip the execution, but only prevent the plugin from doing anything:

    
        org.eclipse.xtend
        xtend-maven-plugin
        2.5.3
        
            
                xtend-testCompile
                
                    xtend-testCompile
                
            
        
    
    

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