You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ IDEA 2019.3.1如何将.iml文件存储到独立文件夹?

IntelliJ IDEA 2019.3.1: Can't Specify .iml File Location When Importing Maven Modules?

Hey Patrick, thanks for walking through your issue in such detail—let’s break this down clearly for you:

Is this expected behavior or a bug?

This is expected behavior, not a bug. JetBrains streamlined the Maven module import workflow starting in IntelliJ IDEA 2019.3 to align more closely with standard Maven project structures. The removal of the "Next" button (and the option to choose .iml file location mid-import) was intentional, as they shifted toward keeping module configuration files directly alongside source code by default.

How to move .iml files out of the source directory in 2019.3.1

You don’t have to rely on error-prone manual edits of .iml or modules.xml files—there are built-in, safe ways to handle this:

1. Configure the location before importing modules

  • Open File > Settings (or IntelliJ IDEA > Preferences on macOS)
  • Navigate to Build, Execution, Deployment > Build Tools > Maven > Importing
  • Look for the Generated files location field. Set this to your preferred external directory (e.g., <your-project-root>/.idea/modules)
  • Now when you import your Maven module, the .iml file will automatically be generated in this specified path instead of the source folder

2. Adjust location for already imported modules

If you’ve already imported the module and need to move the .iml file:

  • Open File > Project Structure (shortcut: Ctrl+Alt+Shift+S on Windows/Linux, Cmd+; on macOS)
  • Select the target module from the left sidebar
  • Switch to the Paths tab
  • Modify the Module file location to your desired directory
  • Click Apply—IntelliJ will automatically move the .iml file to the new location and update all related configuration files (like modules.xml) for you, no manual edits needed

Bonus: Reverting to the old workflow (if possible)

Some users reported that early 2019.3 builds had an option under File > Settings > Appearance & Behavior > System Settings > Projects called Use old project model, but this was removed in later updates. If you don’t see this option, stick with the two methods above—they’re the supported, stable ways to manage .iml file locations.

内容的提问来源于stack exchange,提问作者pat_b13

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 07:42:34