What if you don't activate the profiles fully in settings.xml, don't
activate them by default in settings.xml but, instead, activate them based
on an environment variable on the machine?

You could "set MAVEN_SETTINGS_PROFILES=default" in the startup for the
developer's workstation/laptop. Then put in the option to activate those
default profiles

<profiles>
  <profile>
    <activation>
      <property>
        <name>env.MAVEN_SETTINGS_PROFILES</name>
        <value>default</value>
      </property>
    </activation>
    ...
  </profile>
</profiles>


If that developer is going to be doing something unusual, they would clear
the value of the environment variable and use the -Pprofile1,profile2
command line profile setter when building the non-standard stuff.

Thanks.

Lee

On Fri, Mar 25, 2011 at 4:02 PM, Rafael Vanderlei <rafaelvander...@gmail.com
> wrote:

> Hi, Wendy.
>
> I have many dependencies on runtime and they vary on many environments.
>
> Basically, my application must be able to run in 5 different environments,
> named local (which actually is the machine of the developer), development,
> integration, trainning and production. In which of those environments, I
> have other applications on which mine depends and so I have a bunch of
> combinations of profiles for each environment and for each application on
> which mine depends.
>
> The whole organization of environments/applications is something like this:
>
> - Enviroment 1
> --- MyApplication, Application B, Application C, Application D, Application
> E
> - Enviroment 2
> --- MyApplication, Application B, Application C, Application D, Application
> E
> - Enviroment 3
> --- MyApplication, Application B, Application C, Application D, Application
> E
> - Enviroment 4
> --- MyApplication, Application B, Application C, Application D, Application
> E
> - Enviroment 5
> --- MyApplication, Application B, Application C, Application D, Application
> E
>
>
> I need my build configuration to be flexible enough to allow someone to
> build "MyApplication" for the Environment1 that uses "Application B" that
> runs on "Environment 2", "Application C that runs on Environment 3"...
> well.. any variations of those Apps and Envs..
>
> So, the default profiles are supposed to determine the configuration of the
> local enviroment, which is the machine of each developer, but when I try to
> build for another environment, I dont want the default profiles to be
> activated, because they will contain configurations specific only for the
> local environment and those default profiles come into direct conflict with
> the profiles for the other environments.
>
> I think people may be confused by reading all these explanations about the
> real case I´m working on and that´s why I tried to hide it on the first
> post
> and questioned only specific details about Maven profiles, which I think
> would easier to analyse and answer.
>
> I hope this helped more than messed things up lol.
>
> Regards,
>
> Rafael.
>
>
> On Fri, Mar 25, 2011 at 5:30 PM, Wendy Smoak <wsm...@gmail.com> wrote:
>
> > On Fri, Mar 25, 2011 at 12:18 PM, Rafael Vanderlei
> > <rafaelvander...@gmail.com> wrote:
> >
> > > If I configure my .m2/settings.xml to activate some profiles, is there
> a
> > way
> > > to deactivate all of them  on the command line "in one go", so I can
> use
> > > only explicitly typed profiles?
> >
> > Why are there so many profiles and what are they for?
> >
> > (If you explain what problem you're trying to solve, someone can
> > probably help you come up with a better solution.  Clearly, having a
> > bunch of profiles that are active by default and then wanting them to
> > NOT be active indicates something is wrong.)
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>



-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com

Reply via email to