How to activate a Maven Profile for a specific module in a mutli-module project

后端 未结 2 628
天命终不由人
天命终不由人 2021-01-18 16:34

We have a multi-module Maven project consisting of a parent POM and 5 or more modules.

Each module can be deployed to a running server as part of the build if we act

2条回答
  •  悲&欢浪女
    2021-01-18 17:11

    If each of your modules will have it's own "auto-deploy" profile, and profile activation will be triggered by variables passed to mvn command, you will be able to run single mvn command on parent module and decide which modules should be deployed simply by declaring activation variables

    
        
            profileId
            
                
                    profileIdEnabled
                    true
                
            
            
        
    
    

    and then

    mvn -DprofileIdEnabled=true
    

提交回复
热议问题