Running a specific Maven plugin goal from the command line in a sub-module of a multi-module reactor project

前端 未结 4 1715
半阙折子戏
半阙折子戏 2020-11-29 04:49

I\'m looking for a general technique here, but let\'s give a specific example. I have a multi-module project and I\'d like to run the exec:java goal from the co

4条回答
  •  半阙折子戏
    2020-11-29 05:05

    There is another way which lets you choose multiple modules to execute a plugin.

    Many plugins have a skip option, which you can activate on the root project by setting its value to true. The plugin execution will be skipped by default for all sub-modules then. Sub-modules that should execute the plugin can explicitly set skip to false. You still need to configure any non-optional attributes in the root project.

    Example of the exec-maven-plugin with configuration for the exec:exec goal:

    
    
        
            
                
                    org.codehaus.mojo
                    exec-maven-plugin
                    1.3.2
                    
                        true
                        java
                    
                
            
        
    
    
    
    
        
            
                org.codehaus.mojo
                exec-maven-plugin
                
                    false
                    
                
            
       
    
    

提交回复
热议问题