Intellij: Get rid of iml file

已回答
  • A colleague has downloaded my project which I've composed using IntelliJ-2019.2 On my machine, there is no .iml file (not in project root, nor in .idea folder).

  • He opened it using IntelliJ-2018.1 and a .iml file was created in project root.

  • We thought we could: Close IntelliJ-2018, uninstall, install 2019.2, delete the .iml and reopen the project with 2019.2.

However, that .iml file was created again...

Since he will be pushing to a repo, and in general because we want the whole team to work in the same way, I would like to remove this .iml, so that his project is handled by the IDE in the same way as the rest of the team.

How to "migrate" from .iml to whatever module description I am using (which has no .iml)?

0

Hello,

Is it a Gradle based project?

 

0

Hi, it's a Maven "quickstart" project

0

Please check "Store generated project files externally" option state in "Settings/Preferences | Build, Execution, Deployment | Build Tools | Maven | Importing": https://www.jetbrains.com/help/idea/maven-importing.html

1

The state as I found it was that it was unchecked. Checking it did not remove the iml file.

0

It should work on initial import. If you check that option, remove .iml file and reimport project then .iml files shouldn't be placed in project.

1
Avatar
Permanently deleted user

We have .gitignore setup to ignore most IDE created files and folders, including, but not limited to .iml files

0

Still very annoying to have to deal with this file and have it clutter the project. If it isn't pushed and is project specific and ide specific, why can't it live in the idea folder? It seems the original solution herein is being discontinued per the current setting page. I never realized it was applicable to only maven, thought it used to work everywhere to get the iml files out of my project. Is there a solution?

0

@gunslingor gunslingorsadf In the latest IDEA version, if the "Import using the new IntelliJ Work" option is enabled (by default for new projects) in the `File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing`, the IDEA would hide the "Store generated project files under the project root" option so you can't see it. And in this case, you could remove the `.iml` files in your Maven project directly and the IDEA doesn't need the `.iml` file too.

If that option is disabled, it would use the old way to import the Maven project which also provides the "Store generated project files under the project root" option to let you choose if store the `.iml` in this project folder root.

 

1

Has the ui changed in 2023 version..

don't see the option to get rid of .iml file, it is so destracting to see these extra files.. why not use .idea folder to dump all these IDE related files.. pl. do some thing intellj don;t remove good features and bring in bad features

1

Hello,

Please disable "Enable fast import" option to see old menu.

0

Thank you by disabling fast import, I could see the menu.. however

 

 

The Option says deprecated.. in future is there any other way... 

0

Do you open some old project or create new one?

0

I have old project that uses maven pom.xml, that I am opening as project..

0

Sorry, but with "fast import" option enabled .iml file is not created. So, you got desired behavior.

1

请先登录再写评论。