Hi Łukasz,
> So you want to say that I'm always forced to add -P switch to maven
> call to change values?
Nope, I think what Anders meant is something like:
<properties>
<myProp>slowmode</myProp>
</properties>
......
<profiles>
<profile>
<id>turboMode</id>
<activation>
<property>
<name>env.turboMode</name>
</property>
</activation>
<properties>
<myProp>${env.turboMode}</myProp>
</properties>
</profile>
</profiles>
For details, see:
http://maven.apache.org/pom.html#Activation
> One more question, system property always overwrites property?
Sorry, not sure what you're asking here.
HTH,
Curtis
On Tue, Jun 19, 2012 at 7:59 AM, Łukasz Tasz <[email protected]> wrote:
> Hi thanks for answer,
>
> 2012/6/19 Anders Hammar <[email protected]>:
> > You can accomplish something like this through some profiles magic.
> > But I'd like to stress that the Maven theme is to have predictable
> > (and reproducible) builds. To ensure that, the build output can't
> > depend on the environment.
>
> I thought that reproducible build means if input is the same then
> output must be the same :)
> and environment variables are always part of build - at least maven
> gives interface to env.
>
> >
> > But if you absolutely have to do this through profiles, this is what you
> do:
> > * Define the property with the default value.
> > * Create a profile that is triggered on the env variable, and that
> > profile with re-define the property to the value of the env variable
> > (or whatever you want).
> So you want to say that I'm always forced to add -P switch to maven
> call to change values?
> Maybe I will explain reasons,
> I'm signing jars with jarsigner plugin.
> There is requirement that developer build is executed within same
> profiles sets.
> Since not each developer cares about signing rpms, I would like to
> provide default dummy key - through default properties,
> but in case of qa build, env vars will point real keystore.
>
> One more question, system property always overwrites property?
>
> br
> L.
> >
> > /Anders
> >
> > On Tue, Jun 19, 2012 at 2:03 PM, Łukasz Tasz <[email protected]> wrote:
> >> Hi All,
> >>
> >> I'm not mvn expert, but I'm working a lot others build systems.
> >> I'm missing one of fundamental functionality, default value for
> >> variable / property in case of maven.
> >>
> >> I would like to start mvn process and optionally parametrize it by
> >> environment variable.
> >>
> >> e.g
> >> <properties>
> >> <myProp>${env.turboMode}:slowmode</myProp>
> >> </properties>
> >>
> >> so if environmente variable is seted then myProp will get it;s value,
> >> if not then slowmode will be the value.
> >>
> >> I' sure that I'm missing some manual page, but please don't blame :)
> >>
> >> Thanks a lot
> >>
> >> --
> >> Łukasz Tasz
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
>
>
> --
> --
> Łukasz Tasz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>