Using the processor to generate a series of config files for different environments

32 views
Skip to first unread message

James

unread,
May 8, 2012, 1:37:31 AM5/8/12
to maven-config-processor-users
Hi all

I came across this project while looking for a solution to generating
config files for all our target environments.

What I'd like to do is setup a number of transform jobs that start
with the same input file, but apply a set of properties that should be
used for that transform job (and not the others, like
specificProperties does).

i.e. input file might look like:
property.one=some value
property.two=another value
property.three=${overlay.property}/path/to/service

overlay file might look like:
property.two=specific value
overlay.property=http://env1.com/test

output file should look like:
property.one=some value
property.two=specific value
property.three=http://env1.com/test/path/to/service

Is this possible within the project already? Do you think there would
be much use for an overlayProperties option within a transform?

Speak soon
James

Leandro de Oliveira

unread,
May 8, 2012, 12:38:12 PM5/8/12
to maven-config-p...@googlegroups.com
This plugins does exactly this, I think you'll need to create a
profile for each target environment configuring the plugin for it.
Take a look at http://code.google.com/p/maven-config-processor-plugin/wiki/HowTo

2012/5/8 James <jvul...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "maven-config-processor-users" group.
> To post to this group, send email to maven-config-p...@googlegroups.com.
> To unsubscribe from this group, send email to maven-config-process...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/maven-config-processor-users?hl=en.
>

James

unread,
May 9, 2012, 6:44:31 PM5/9/12
to maven-config-processor-users

Thanks Leandro.
The only thing I found difficult about this was that we want to
generate all the configs for all the environments in a single step. We
hope to have one build of code and configs for all environments
generated at the same time.

Would this config mean that we need to execute the target once for
each environment?


On May 9, 2:38 am, Leandro de Oliveira <lehph...@gmail.com> wrote:
> This plugins does exactly this, I think you'll need to create a
> profile for each target environment configuring the plugin for it.
> Take a look athttp://code.google.com/p/maven-config-processor-plugin/wiki/HowTo
>
> 2012/5/8 James <jvull...@gmail.com>:

Leandro de Oliveira

unread,
May 9, 2012, 7:26:31 PM5/9/12
to maven-config-p...@googlegroups.com
You could do something like the following:

<transformation>
<input>input.properties</input>
<output>env1/output.properties</output>
<rules>
<modify>
...
</modify>
</rules>
</transformation>
<transformation>
<input>input.properties</input>
<output>env2/output.properties</output>
<rules>
...
</rules>
</transformation>
...

Then you create a zip file for each environment using the assembly
plugin and the generated files. All in a single build.

You can't have a property.three=${overlay.property}/path/to/service in
your input file because we need to know which environment value should
replace ${overlay.property}, and the only ways to do it are using
profiles or changing the plugin to support properties definition
inside transformation configs.

2012/5/9 James <jvul...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages