How to activate profile by means of maven property?

前端 未结 7 1314
Happy的楠姐
Happy的楠姐 2020-12-05 10:25

I\'m trying to activate a maven profile using a property defined inside pom.xml:


  [...]
  
             


        
7条回答
  •  遥遥无期
    2020-12-05 10:50

    In recent maven versions (3.5+?) you can create a .mvn folder at the root of your project and a file .mvn/maven.config. In this file you can then activate profiles or set properties as you would do on the command line.

    activate a profile through a property:
    -Dactivate.myprofile=true
    
    activate a profile directly
    -Pmyprofile
    

    Hopefully maven5 will get support for Mixins, which will probably make build settings more reusable.

提交回复
热议问题