jjathman
jjathman

Reputation: 12604

How to make IntelliJ Project Files Respect Maven Profile

I have imported a maven project which uses profiles in to IntelliJ. Under the maven projects window I see the profiles and see all of my projects listed correctly. When I select a profile it does update the dependencies under the projects with profiles defined. The problem seems to be that IntelliJ does not actually update its project files (*.iml files) with these updated dependencies.

The problem I'm having is that when I run the application through IntelliJ it does not run with the correct classpath because the iml file hasn't been updated with the correct dependencies for the active profile.

Am I doing something wrong here or is this just not possible to have IntelliJ use dependencies only defined under a profile?

Upvotes: 1

Views: 456

Answers (1)

arghtype
arghtype

Reputation: 4534

After switching to new profile you sometimes have to force synchronization:

Right click your .iml file in project browser and choose Synchronize iml option. For multi-module project it could be required to sync both parent and specific module.

p.s. I've just tested it in 14.1.2 Community Edition.

Upvotes: 1

Related Questions