Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I rebuild/make .iml files in maven multi-module project in Intellij 13.1.4

I'm working in a multi-module maven project in Intellij. There was a snapshot update in another module which required an update in a few POMs. Normally I will click the "Re-import all maven projects" from the maven plugins tool then do a full build.

However, this time the .iml files associated with the changed POMs weren't being updated. It wasn't until I did "Build->Rebuild Project" that the .iml files were updated. Does anyone know how to update .iml files as part of a build configuration?

Note: Before rebuilding the project, I know mvn at least picked up on the change because my local .m2 repo had the latest snapshot.

EDIT #1: So, this is also true if I add a maven runtime dependency in a module. It won't pick up the change unless I do rebuild project.

like image 298
Carlos Bribiescas Avatar asked Sep 10 '14 15:09

Carlos Bribiescas


1 Answers

I've experienced similar issues with newer versions of IntelliJ (2018.2.7) where my .iml is out of date. It happens inconsistently, so I'm not sure what the root cause is, but the following work around allows me to avoid doing a full rebuild:

  1. Delete the .iml file and .idea folder for the project
  2. Reimport the pom.xml for the project
  3. IntelliJ will automagically regenerate an updated .iml file.
like image 150
ilooner Avatar answered Oct 24 '22 11:10

ilooner