作者:MesecretyMark | 来源:互联网 | 2023-01-04 15:30
每次创建Maven项目时,都会有一个.iml
文件和一个pom.xml
文件.他们的关系究竟是什么?
1> gjoranv..:
The pom.xml is used by maven to resolve your project's dependencies, which plugins to execute and a lot of other things. From the maven website:
A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project.
The .iml
file on the other hand is part of IntelliJ's own project structure. The short version is that it declares the libraries (e.g. jars) that are visible only to the module, and not the rest of the project or other projects. It's an xml file containing a library entry for each artifact declared in your pom.xml
, along with its scope (e.g. TEST
or COMPILE
). For example:
I assume IntelliJ keeps its own file format so it can read the project faster, regardless of which build system the project is using (e.g. maven vs. gradle).