Maven profiles are not considered in Eclipse

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

I have three profiles defined in my pom.xml:

   
    
        ABC
        
                     


        
相关标签:
3条回答
  • 2021-01-17 15:18

    Go to

    Properties-->Maven-->Active Maven Profiles

    and type in only the profile name that you want to run.

    If you want to run your ABC profile type in ABC in the Active Maven Profile input box.

    The description(seperated by commas) given there is a bit confusing.

    Once you define your profile name or id in the input box. You can clean and run your project on your server. By doing so your mentioned active maven profile will be run.

    0 讨论(0)
  • 2021-01-17 15:26

    verify that plugin execution id are not equal in different profiles

    0 讨论(0)
  • 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 <activeProfile>MyProfileId</activeProfile> 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.

    0 讨论(0)
提交回复
热议问题