IntelliJ Build>重建项目调用maven? [英] Does IntelliJ Build > Rebuild Project invoke maven?

查看:202
本文介绍了IntelliJ Build>重建项目调用maven?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IntelliJ 14.1中, Build>时会发生什么?为maven项目调用重建项目




  • 是否调用mvn compile?

  • 它是否独立于maven做了什么?



我试过测试这个,当我点击 Build>重建项目我看不到任何控制台输出指示maven正在运行,如果我从maven项目视图运行maven,我得到maven输出。



<那么 IntelliJ Build>之间的关系到底是什么?重建项目和构建工具,如 maven / gradle / ant

解决方案

不,IntelliJ IDEA make不会调用Maven。当您打开Maven或Gradle项目时,它会读取项目的设置并将其存储为其内部项目模型的一部分。调用Build时,它使用导入的设置使用自己的构建系统编译项目。 Rebuild Project保留现有的导入设置,删除所有.class文件和IntelliJ的增量编译缓存,并使用IntelliJ IDEA的构建系统执行项目的完整构建。



优势这样做是因为IntelliJ IDEA构建系统支持非常细粒度的增量重建(例如,如果更改方法的签名,它将只重新编译那些实际调用该方法的类,而不是任何其他代码)。 / p>

请注意,您可以将IntelliJ IDEA配置为在主项目编译之前或之后运行Ant任务或Maven目标,因此如果您的构建正在执行非标准的操作,您仍然可以将它与IntelliJ IDEA构建系统一起使用。


In IntelliJ 14.1 what exactly happens when Build > Rebuild Project is invoked for a maven project.

  • Does it call mvn compile?
  • Does it do something independent of maven?

I have tried to testing this and when I click Build > Rebuild Project I can't see any console output indicating that maven is running, if I run maven from the maven projects view I get maven output.

So what exactly is the relationship between IntelliJ Build > Rebuild Project and build tools such as maven / gradle / ant?

解决方案

No, the IntelliJ IDEA make does not invoke Maven. When you open a Maven or Gradle project, it reads the settings of the project and stores them as part of its internal project model. When you invoke Build, it uses the imported settings to compile your project using its own build system. Rebuild Project keeps the existing imported settings, deletes all .class files and IntelliJ's incremental compilation caches, and performs a full build of the project using IntelliJ IDEA's build system.

The advantage of doing that is that the IntelliJ IDEA build system supports very fine-grained incremental rebuilds (for example, if you change the signature of the method, it will recompile only those classes which actually call the method, and not any other code).

Note that you can configure IntelliJ IDEA to run an Ant task or a Maven goal either before or after the main project compilation, so if your build is doing something non-standard, you can still use it with the IntelliJ IDEA build system.

这篇关于IntelliJ Build&gt;重建项目调用maven?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆