I get this WARNING when I try to build my maven project. I have searched google but with no luck. This is really annoying since I wanna release my project but it wont work with this warning (I think). The build is successful, but when I try to deploy the war file it doesen't work (no error message). The only warning I can find when I build the project is this:
[WARNING] The requested profile "projectname" could not be activated because it does not exist.
This happens when you have the following in your settings.xml (in your .m2 directory), and no profile with the id projectname.
<activeProfiles>
<activeProfile>projectname</activeProfile>
</activeProfiles>
You need to configure your project pom.xml with the following profile:
<profiles>
<profile>
<id>**projectid**</id>
</profile>
</profiles>
If you run
MVN clean install
from command line and do not get the warning, but get it if you run it from Eclipse m2e plugin, check if you have set a profile in the (default) Run configuration.
In Eclipse Project Explorer, select the project, right click > Run As > Run Configurations. Check the m2 run configurations of your project. Check if you have "projectname", i.e. the profile mentioned in the WARNING is provided in the Profiles parameter. Remove the profile from the profiles form field in the dialog. The cause may be that you have had a in you pom.xml, and used it in the build. When you remove it from pom.xml - it remains in the run configuration, even if it does not show up in the project explorer's Maven context menu (Maven > Select Maven Profiles ...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With