How can I assign a specific maven profile to an intellij run configuration?

Grammin picture Grammin · Jun 23, 2016 · Viewed 27.9k times · Source

I have multiple projects loaded into my project structure and they all use different maven profiles. I know I can switch up the profiles using the Maven Projects tab but I would like to assign a specific profile to go along with a specific run configuration.

Answer

Vijendra Kumar Kulhade picture Vijendra Kumar Kulhade · Jun 24, 2016

If You have created maven profiles in your pom.xml, you should be able to see the profiles in right side of Intellij Idea

You can select this profile

If there will be multiple profile you can activate one by default

           <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

Or for running specific profile we can select mvn install -Pbuild-profile