java - maven pass command argument at build time to overwrite property -


in our application, have system whitelabel.

in application.properties there setting theme=default

this setting injected spring managed bean, manipulation of app through framework, adding correct css, etc

what able do, @ build time (war creation), specify theme, eg mvn clean install -theme:some-theme. update application.properties, , modify theme , if run mvn clean install theme=default or unmodified

is possible?

the proper way set property via command-line using -d:

mvn -dproperty=value clean package 

it overwrite property defined in pom.xml.


so if have in pom.xml:

<properties>     <theme>mydefaulttheme</theme> </properties> 

mvn -dtheme=halloween clean package overwrite themes value during execution, having effect if had:

<properties>     <theme>halloween</theme> </properties> 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -