0

I want to make IDEA's maven project not generate iml files, but only pom.xml files, how can I do this? Don't hide the .iml file, just need to delete it, I tried searching and reading IDEA manual but didn't find an answer. My IDEA version:IntelliJ IDEA 2022.1.3 (Ultimate Edition)

threecat
  • 1
  • 1
  • These are important to persist ide state between sessions. Just tell git to ignore them. – Thorbjørn Ravn Andersen Aug 18 '22 at 05:21
  • Thanks for your reply, I totally agree with what you said. My quersion is just to see if there is such a way. Because I didi not find .iml file in a maven project, and the project works fine,which makes me wonder(I'm sure the .iml file is not hidden).
    Thanks again for your reply and have a nice day!
    – threecat Aug 18 '22 at 07:12
  • IntelliJ creates them as information is gathered. – Thorbjørn Ravn Andersen Aug 18 '22 at 08:13
  • Thanks for your reply, but I don't find the .iml files in my maven project (I know how to generate .iml file manually), and my project works fine, I have tried many ways but no iml file is found, so I'm confused.Thanks again for your reply and have a nice day! – threecat Aug 18 '22 at 09:07
  • Look for the “Store generated project files externally” setting. If checked idea do not pollute your work files. – Thorbjørn Ravn Andersen Aug 18 '22 at 13:26
  • Thanks for your reply, I have checked this button. – threecat Aug 19 '22 at 00:41
  • Then the IML files should be outside any new project you create. For existing projects this doesn't change – Thorbjørn Ravn Andersen Aug 22 '22 at 07:03
  • @ThorbjørnRavnAndersen Thank you very much, you are right. However, my situation is such that when I pull the remote maven project from git and open it in IDEA, the .iml file is not found, but the project can run normally(It's not the same as what you're describing). I don't know if you understand such a situation, if so thanks for the explanation.
    Thanks for your reply and have a nice day!
    – threecat Aug 23 '22 at 08:13
  • When opening a maven project, IntelliJ can derive most of the information it needs from the Pom files, but not everything which it seems that is what you believe. Just don’t check iml files into version control and you are fine. – Thorbjørn Ravn Andersen Aug 23 '22 at 08:26
  • @ThorbjørnRavnAndersen Your answer solved my big doubt, thank you very much. But I still want to ask if it is possible without .iml file, because maven can do the same thing (I didn't find an answer to this question on Google). – threecat Aug 23 '22 at 08:47
  • @ThorbjørnRavnAndersen Sincerely thank you for your reply, this comment is the answer to the question, if you initiate an answer I can accept it, but comments don't seem to work that way(Can't accept a comment as an answer in the stack overflow). Have a nice life and thank you very much. – threecat Aug 23 '22 at 10:27

0 Answers0