Maven profiles are not considered in Eclipse

后端 未结 3 1069
遥遥无期
遥遥无期 2021-01-17 14:57

I have three profiles defined in my pom.xml:

   
    
        ABC
        
                     


        
3条回答
  •  臣服心动
    2021-01-17 15:29

    For those who still have problems. I am not really used to Eclipse nor STS but I actually use Spring Tool Suite Version: 4.7.1.RELEASE. I think the Active Maven Profile input box. may be named Write here your already activated Maven Profile :) as I think its purpose is to select an activated profile to run.

    In my case, what I did was :

    1. edit my Maven settings.xml (maven folder, conf folder) file to activate the desired profile with MyProfileId in the activeProfiles section. The one thing I really appreciate is that it accepts profile even defined in your project pom.xml and that is great for peoject with sub modules. If you have time, read this https://maven.apache.org/guides/introduction/introduction-to-profiles.html
    2. Then add your profile to Active Maven Profile input box (Ctrl+Alt+P or right click on your project, Maven, Select Maven profiles). You can also deactivate a profile with ! or - before a profile name. You might need to restart Eclipse.

    The first step is only to activate your profile. So if you have any way to achieve this, feel free to do as so.

提交回复
热议问题