intellij Project make 和 Maven Compile 之间的区别?

Difference between intellij Project make and Maven Compile?(intellij Project make 和 Maven Compile 之间的区别?)

本文介绍了intellij Project make 和 Maven Compile 之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 maven 模块中工作时,在 intellij build 中进行操作有什么区别->制作项目和 Maven 项目 ->根 pom ->编译阶段.

When working in maven module, what's the difference between doing in intellij build -> Make Project and Maven Projects -> Root pom -> Compile phase.

intellij 调用 maven 吗?他们都将源代码编译到同一个地方吗?他们都复制资源文件吗?为什么我们需要这两种选择?intellij 会自动下载依赖,我们可以直接调用 project make,而不使用 maven compile?

Does intellij calls maven? Does both of them compile the sources to the same place? Do they both copy resources files? Why do we need both options? Does intellij download the dependencies automatically and we can just call project make, without using maven compile?

推荐答案

它们执行的任务实际上非常相似,即默认使用 javax.tools.JavaCompiler 编译项目的源和测试路径.

They are actually quite similar in terms of the task they perform which is to compile the source and test paths of the project with javax.tools.JavaCompiler by default.

intellij 调用 maven 吗?

不,默认情况下不会.请记住,这只是 IntelliJ 内置的 Java 编译器,一些 Java 项目不使用 maven.

No it doesn't by default. Remember that this is just IntelliJ's built in Java compiler and some Java projects don't use maven.

他们是否都将源代码编译到同一个地方?

是的,如果您在此处询问,他们使用相同的源文件进行编译.

Yes, they use the same source files to compile if that's what you are asking here.

它们都复制资源文件吗?

是的,他们都将资源文件复制到不同的位置.

Yes they both copy the resource files to different locations though.

为什么我们需要这两个选项?

我们不需要这两种选择.Maven 编译命令会针对任何语法错误检查源代码,这些错误有效地涵盖了 IntelliJ 的 make 选项所做的工作.

We don't need both options. Maven compile command checks the source code against any syntactical errors which effectively covers the work done by IntelliJ's make option.

intellij 是否会自动下载依赖,我们可以直接调用 project make,而不使用 maven compile?

Intellij 的编译器可以被认为是语法编译器,这就是为什么你需要 maven 来处理你的项目的依赖.

Intellij's compiler can be considered as syntax compiler which is why you need maven to handle your project's dependencies.

这篇关于intellij Project make 和 Maven Compile 之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:intellij Project make 和 Maven Compile 之间的区别?

基础教程推荐