How to skip install phase in Maven build if I already have this version installed in repo

后端 未结 5 1623
甜味超标
甜味超标 2020-12-09 03:41

I have a project that consist of 3 different libraries. When I run install script it takes all libraries from repo and run mvn clean install on them. But this version of lib

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 04:08

    Most maven plugins can be skipped by specifying something like:

            
              maven-install-plugin
              X.Y
              
                true
              
            
    

    you can also set up build profiles to set properties and use that to determine the value. for example, running the command: mvn -Pexample would select the "example" profile. The POM would then contain:

    ...
      
        false
    ...
      
    
    ...
        
          example
          
            false
          
        
    ...
        
          maven-install-plugin
          X.Y
          
            ${skip.install}
          
        
    ...
    

    Using these POM additions, the default behavior for the install plugin will be to perform its default goal, but if the example profile is selected, then the install plugin will skip its goal.

提交回复
热议问题