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-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to