热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

.iml文件和pom.xml文件之间的关系

如何解决《.iml文件和pom.xml文件之间的关系》经验,为你挑选了1个好方法。

每次创建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).


推荐阅读
author-avatar
MesecretyMark
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有