Deleted .iml File in IntelliJ

Unfortunately i somehow deleted my Applications .iml file. Now my Project somehow seems broken because my modules are not displayed anymore.
2 answers

For Maven projects you can go like this:

Open the maven the tool window. In Intellij you can do this by right click on the project name and then click on "maven tool window".

Then click on the reimport all maven projects.

Now your project should be stable again

Taggings:

First of the .*iml files do not have anything to do with your code. It is only a file created by the IDE to contain module information.

If you are using maven you can reimport your projects modules as follows:
Go to File > Project Structures > Modules > Add > Import Modules > > OK.

After that you have to go to the maven Tool window and click on the reimport button.

Comments

If you are having a Gradle project instead of Maven, the IDE files (.iml) can be generated using the following workflow:

Go to the Gradle tool window of your IDE (e.g. IntelliJ): View > Tool Windows > Gradle
Click the refresh icon with the tooltip "Refresh all Gradle projects"

Josef Wechselauer - Tue, 12/08/2020 - 09:20 :::