Skip a submodule during a Maven build

后端 未结 5 1712
暖寄归人
暖寄归人 2020-11-30 17:42

We have a need to be able to skip a submodule in certain environments.

The module in question contains integration tests and takes half an hour to run. So we want t

5条回答
  •  無奈伤痛
    2020-11-30 18:08

    Sure, this can be done using profiles. You can do something like the following in your parent pom.xml.

      ...
       
          module1
          module2  
          ...
      
      ...
      
         
           ci
              
                module1
                module2
                ...
                module-integration-test
               
          
      
     ...
    

    In your CI, you would run maven with the ci profile, i.e. mvn -P ci clean install

提交回复
热议问题