You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by MavenUser8979 <mi...@yahoo.com> on 2011/10/27 11:53:21 UTC

Reading property file based on configuration.

I have one  requirement where I want to read properties file based on
configuration.

I have one folder where I have global environment related properties.

e.g. env.properties is having two properties.

SubEnvName=245SolarisMachine
GlobalEnvDir=/apps

Now I have all sub-enviroment related properties inside
${SubEnvName}.properties

e.g.
245SolarisMachine.properties
246SolarisMachine.properties
247SolarisMachine.properties

Now my goal is to read first env.properties file and find environment name.

Using this name I want to load all properties of given sub-env(e.g.
245SolarisMachine.properties
in this case) and do a token replace in some XML file.

But it seems this is too much programatic and cannot be done using Maven.

Any one is having any idea on this.





--
View this message in context: http://maven.40175.n5.nabble.com/Reading-property-file-based-on-configuration-tp4942492p4942492.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Reading property file based on configuration.

Posted by Wayne Fay <wa...@gmail.com>.
> Now my goal is to read first env.properties file and find environment
name.
>
> Using this name I want to load all properties of given sub-env(e.g.
> 245SolarisMachine.properties
> in this case) and do a token replace in some XML file.
>
> But it seems this is too much programatic and cannot be done using Maven.

If you cannot find a way to do it with core Maven and existing plugins, then
you will need to write your own plugin to do this specific functionality
that you require. You could even use the source code from the replace plugin
as the basis for your work.

Wayne