When importing Maven project IDEA represents its dependencies model in the format that it can understand and use internally. If you manage dependencies via Maven, you don't need to change the dependencies in the IntelliJ IDEA module setting.
This can be also used to experiment with dependencies without changing the pom.xml
. Note that all the modifications you make will be reverted on next Maven import.
In other words, IDEA doesn't understand Maven model directly, it converts it to its own project model used by all the subsystems, and the internal project information needs to be stored somewhere, hence the .iml
files and .idea
project directory. This way IDEA doesn't need to analyze the pom file every time you open the project and resolve all the dependencies again, it's done only when the pom.xml
changes.
As you can build/run/test/deploy/debug Maven projects in IDEA without using Maven at all, the information needed for these tasks is stored in the format that IDE can understand itself. It's faster, easier to maintain and I guess was easier to implement than reading Maven model directly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…