Setting default values for custom Maven 2 properties

前端 未结 6 1821
误落风尘
误落风尘 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:02

    This might work for you:

    
      
        default
        
          true
        
        
         
           
            Foo
           
         
        
        ...
      
      
        notdefault
        ...
         
          
            
                ${myProperty}
            
         
         
        ...
      
    
    

    That way,

    mvn clean will use "foo" as your default param. In cases when you need to override, use mvn -P notdefault -DmyProperty=something

提交回复
热议问题