Thanks Eugene for your swift reply, Actually, the command line version exhibits the same behavior, i.e. the properties of the active profile are seemingly not used. We tried altering the MavenCli class, in the main method, to copy the properties of the active profiles to the System properties. After that operation I get the desired result when invoking Maven from the command line. I've prepared a simple example (uploaded with the MNG-3782 issue), containing three projects, that displays the problem. Altering and building Maven, as mentioned before, I get it to compile the example nicely.
Next step is to have the same behavior with m2eclipse, so we can have the projects compile in Eclipse. However, I get a big red dot on one of the projects in the example and thus the simple patch in MavenCli is not effective. So I have to rework it somehow - thanks for pointing out the fact that all profile resolution is within the Maven code, not m2eclipse, meaning I won't dig too deep into the m2eclipse code. Also, as you mention, setting the active profile in the maven project properties page is possible. Tried it, but it seemingly has no effect, at least not for my properties in the active profile. If I pass the properties as command line options (-D...) it all works fine, as expected. Thats how I found about passing these to the System Properties. And, thus, the simplistic modicifaction. However, using the -D option is not really an option the Eclipse case... I realize I have to dig a bit deeper beyond the MavenCli class. I geuss looking into the embedder might be a start? Could you please advice on which package/classes to look into where the profile is resolved. Also, which class reads the System properties and performs the variable substitution in POM:s? Thanks advance, Robert P.S. If you like, I can post the example.zip and the settings.xml for scrutiny. I have refrained from doing this as this list reaches alot of people... ________________________________________ From: Eugene Kuleshov [EMAIL PROTECTED] Sent: Wednesday, October 22, 2008 6:55 PM To: user@m2eclipse.codehaus.org Subject: Re: [m2eclipse-user] Profile seemingly not activated in m2eclipse Robert, Can you please be more specific when profiles are not being activated? Out of the top of my head I can name the following: * project import (active profiles can be explicitly declared in Advanced section of the import/checkout wizards) * dependency resolution (active profiles can be explicitly declared on Maven page in the project preferences) * launching Maven (active profiles can be explicitly declared in the Maven launch configuration preferences and as of las dev build, profiles declared in project preferences are copied into the newly created launch configuration for that project and they are also used by predefined launch shortcuts, like "Run as... / maven install" Please also note that m2eclipse does not read settings.xml and the actual profile resolution is completely inside the Maven code. So, I would start from checking if desired behavior is actually working with the command line Maven. regards, Eugene Robert Varttinen wrote: > I've been experimenting with m2eclipse (ver. 0.9.7) and I have some > trouble getting a permanently activated profile in my settings.xml to > take effect. So, I downloaded the source as Eclipse projects and > started to debug and get a feel for how its internals work ... > unfortunately I am not that proficient with the code and its structure > yet, so it is not that obvious where to look for the profile > activation and reading the relevant properties ... > > Managed to find out that the correct file is identified; there is > a ResolverConfiguration but it returns an empty string when > getActiveProfileList gets called (well a List holding an empty string). > > What is under investiagtion? Well, check > out http://jira.codehaus.org/browse/MNG-3782 for details on what we > would like to achieve (there is a simple example and a settings.xml > file). We have a possible patch for the command line version. It will > uploaded and added to the issue for scrutiny, soon. > > Back to m2eclipse; could somebody please advice on which packages, > classes, to pay extra attention to when it comes to profile activation > and extraction of its properties? Any pointers are welcome. Or, are we > trying to do something which is already implemented and about to be > released shortly? Further, if we are trying to do something which > Maven, and m2eclipse, is not intended to do - please feel free to tell > us ... > > TIA, > Robert --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email