When you have a POM with multiple profiles, there seems to be no way to tell M2E what profile to build with. It will only build the profile that has "active by default" attached to it. if there is no such profile, the build output is incomplete.
Also, when running MVN build in the terminal on a different profile, the "auto build" may kick in and modify the "target" folder simultaneously with the terminal's MVN execution. This causes many hard-to-diagnose problems, like the "target" folder's contents are incorrect, or the JAR contents is incorrect. I only figured this out when i set my other profile to build to a completely separate "target-xxx" folder.
I can disable Java "auto build" and use the "standard" output folder, and a terminal-based MVN works correctly.
I tried setting the Maven plugins options (e.g. -Pdev), but apparently that does not get used when M2E runs MVN.
I don't really want all my profiles to output to different locations, and I don't want to selectively disable "auto build", so is there a way to tell M2E what profile to use, preferably on a per-folder or per-workspace basis.
Is there a way to do this currently?
Be able to tell M2E what profile to use when it rebuilds on an auto-build.
@pyramid-johng you can try to add the following property:
activeProfiles=prod
to
We are missing a setting in this extension to pass parameters to Maven for the build before the run.
Any updates on this? It'd be nice a property to specify the active profile.
I found that seems after updating org.eclipse.m2e.core.prefs. An update project action is also needed to be triggered to make the change active.
Most helpful comment
We are missing a setting in this extension to pass parameters to Maven for the build before the run.