Activating a settings.xml Defined Maven Profile From POM File

后端 未结 2 792
盖世英雄少女心
盖世英雄少女心 2021-01-26 01:41

Our enterprise team maintains a settings.xml file that defines various profiles that development projects can use with Maven to build their artifacts and install th

相关标签:
2条回答
  • 2021-01-26 02:18

    You can use the activateByDefault tag to specify a default profile to use:

        <profile>
               <id>ProfileToActivate</id>
               <activation>
                 <activeByDefault>true</activeByDefault>
               </activation>
        </profile>
    
    0 讨论(0)
  • 2021-01-26 02:18

    After more research, I found a project specific Maven property in Eclipse where I can set the active profiles. You can set this by right-clicking on the project, select "Properties", and select "Maven". You are presented with a text entry box for "Active Maven Profiles (comma separated):".

    That solved my problem.

    I was looking for a more global solution in Eclipse rather than at the project level. But this seems to work.

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