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
Post a Comment