maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: build a maven module project - activation of profile in module
Date Tue, 04 Oct 2011 14:41:29 GMT
No, that is not possible. Profiles themselves are not inherited, but simply
the "result" of them are. So, the behavior you're seeing is correct.

/Anders (mobile)
Den 4 okt 2011 16.25 skrev "GlWyBnp" <glenn.wybo@bnpparibasfortis.com>:
> Dears,
>
> I'm having an issue with profiles in maven.
> Maven version: 2.2.1
>
> *Situation*:
>
> I have the following project structure:
>
> main-parent
> |______ Module project
> |__________ module1
> |__________ module2
> |__________ ...
>
> *Target*:
>
> I have used and written some plug-ins to do some packaging and create a
new
> file in the package:
> - These plug-ins are executed sequentially.
> - These plug-ins should be launched while building for some (not all)
> projects.
> - These plug-ins should be used by other developers, preferably without
> doing to much configuration.
>
> *Solution*:
>
> - The plug-ins are declared in a profile in the parent-pom.
> - The profile will be activated if a certain condition is met (condition:
> the existence of some file)
>
> *Result*
>
> If a module is build where the condition is met for the profile, the
profile
> is activated --> works fine
>
> *Problem*
>
> If the Module project (see image above) is build, then the profile is not
> activated in its modules, even if the condition for the profile is met in
a
> module.
>
> *Reason*
>
> The conditions for the profile to be activated is evaluated in the module
> project and not evaluated again in its modules. The outcome is inherited
in
> its modules. The profile needs not to be launched in the module project,
so
> the condition is false. Therefor the condition is automatically false in
its
> modules (as it is not evaluated again). This is because maven will only
> evaluate the profile from the module project where the build is done.
>
> *Issue*
>
> Ideally, if the build is launch from the module project, even if the
> condition is not met in the module project, it should still be evaluated
> again in its modules. Off course, the work around is to copy the plug-ins
in
> the build of the project where these plug-ins should be fired. This is
> however not what I want, as I would like to automate this process as much
as
> possible.
>
> Is it possible to somehow force the profile to be evaluated again in the
> modules?
> If yes, what is the approach? Best practices?
>
> thanks for any help!
>
> --
> View this message in context:
http://maven.40175.n5.nabble.com/build-a-maven-module-project-activation-of-profile-in-module-tp4868768p4868768.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message