In previous threads, I read about this sort of configuration to activate profiles only when maven is run from m2e, but for some misterious reason I had put in mind that it would need to be done in settings.xml, then I discarded this possibility.
As my real intention is exactly to activate some only when running inside m2e, it´s way better to activate them based on the presence of "m2e.version" property instead of activating them by default (which would also work from inside eclipse, but could cause problems running through CLI).
To avoid the need to trust developers follow such
documentation, I decided to mark profiles I want to be
automatically activated from Eclipse as activeByDefault direct
in the pom.xml.
Maybe it´s not the best solution, but it´s the only one I
found to work "automatically" AND without the need to make any
extra configuration on each developers environment (such as
Eclipse workspace or Maven local configuration in
settings.xml)
As pom.xml is always committed to the version control
repository, if I need to update information, I just need to
commit updated pom.xml and all developers will download it.
Also if a new developer joins the team, the configuration will
already be set in pom.xml and all he needs to do is download
source from the repository.
I believe it may work for you and if you or others have a
better idea please share with us =D
On 15 September 2011 17:28, Greg
Thomas <greg.d.thomas@xxxxxxxxx>
wrote:
>> Have you tried using profiles? Project
properties > Maven > Activate Maven
>> Profiles allows you to activate a specific
profile when building the project
>> under eclipse.
...
> That certainly looks like a potential resolution,
> I'll have a play to see what I can do ..
That certainly did the trick; Many thanks.
However, it does lead to one more question; is there a
way to
automatically activate a profile when m2e imports a
pom.xml in to
Eclipse? That way I don't have to remember to activate
the right one,
or ensure that my colleagues read the documentation
(hah!) when they
import it.