Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Configuring the web.xml file with m2e-wtp

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).

Thanks for reminding, Fred.

Regards,
Rafael.

2011/9/15 Rafał Krzewski <Rafal.Krzewski@xxxxxxxxx>
Now, that's a neat trick!

Thanks,
R.


On 09/15/2011 09:23 PM, Fred Bricon wrote:
You can use the m2e activated profile like :

<profile>
      <id>m2e</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      ...
</profile>
m2e automatically enables this profile by setting the m2e.version property.

HIH. Regards,

Fred Bricon

2011/9/15 Rafael Vanderlei <rafaelvanderlei@xxxxxxxxx>
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 Thu, Sep 15, 2011 at 1:56 PM, Greg Thomas <greg.d.thomas@xxxxxxxxx> wrote:
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.

Thanks again,

Greg
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




--
"Have you tried turning it off and on again" - The IT Crowd
_______________________________________________ m2e-users mailing list m2e-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top