Setting default values for custom Maven 2 properties

前端 未结 6 1818
误落风尘
误落风尘 2020-12-01 03:05

I have a Maven pom.xml with a plugin that I want to be able to control on the command line. Everything works otherwise fine, except even after searching the net a while I ca

6条回答
  •  星月不相逢
    2020-12-01 04:05

    You can have the property default value defined in / or in a profile like shown below. When you supply the property value on command line with -DmyProperty=anotherValue then it will override the definition from the POM. That is, all definitions of property values in the POM are set only a default value for the properties.

    
        ...
        
            defaultValue            
        
        ...
           
              ${myProperty}
           
        ...
    
    

提交回复
热议问题