Change properties in pom.xml at runtime with Maven Ant Tasks. Is it Possible? -


I have a case of the following use: My app starts with an encrypted script, which is about the user's configuration Many questions ask (database settings etc.). These settings are stored in the properties-file

Then I want to run Maven from my ant script through the Meven Ent Task, which is in the properties of my pom.xml with properties of the file -Changed properties should change I do not want to change pom.xml

Is there any way to do this? thank you in advanced!

()

You can redefine properties at Maven, Using the command> Code> -D , the command line and they will override the properties in your project file.

For example, in pom.xml

  & lt; Properties & gt; & Lt; MyProp & gt; & Lt; / MyProp & gt; & Lt; / Properties & gt;  

In your ant build.xml, you can use the mvn command line such as

  mvn -DmyProp = b install  

Which will set myProp in B in the project. Maven discusses using a macro to call the command line. This additional quality can also be easily adapted to pass.

To do this, only use the plugin to launch MyWay in Maven, in the same way pass the command parameter like ant: java work is used.


Comments