Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING The requested profile "projectname" could not be activated because it does not exist

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.
like image 627
benskiiii Avatar asked Jul 12 '13 11:07

benskiiii


3 Answers

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>
like image 187
user3296624 Avatar answered Nov 14 '22 13:11

user3296624


You need to configure your project pom.xml with the following profile:

<profiles>
    <profile>
        <id>**projectid**</id>
    </profile>
</profiles>
like image 38
Eyal Sooliman Avatar answered Nov 14 '22 14:11

Eyal Sooliman


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

like image 4
Andreas Wildhagen Avatar answered Nov 14 '22 14:11

Andreas Wildhagen