Is there a way to capture user input in maven and assign it to a maven property?

后端 未结 2 1109
清酒与你
清酒与你 2020-12-10 04:22
  1. Is there a way to pause the maven execution flow to provide a command prompt so user can input text.
  2. Then I would like the provided text to be stored in a ma
2条回答
  •  既然无缘
    2020-12-10 04:49

    If you add a property in your pom like so:

    
        
    
    

    And use it in your pom somewhere like this:

    ${db.password}
    

    Then you can set the property from command line:

    $ mvn -Ddb.password="DonaldDuck" install
    

    But it is not interactive like a command prompt.

提交回复
热议问题