Eclipse的区别构建项目和Maven编译命令 [英] Difference between Eclipse Build Project and Maven Compile command

查看:1029
本文介绍了Eclipse的区别构建项目和Maven编译命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时的的Eclipse 生成项目命令相同的的Maven 的命令 MVN编译?不要基本上都做同样的事情?

Is Eclipse "Build Project" command same as the Maven command "mvn compile"? Do both basically do the same thing?

如果,然后为什么我需要做一个STS建设项目,以运行没有任何问题的应用程序中运行命令mvn全新安装之后?暗战MVN全新安装应该已经编译了该项目。不应该在刷新STS项目足以运行呢?​​

If Yes, then why do I need to do a "Build Project" in STS after running "mvn clean install" in order to run the application without any issues? Running "mvn clean install" should have already compiled the project. Shouldn't Refreshing the project in STS be enough to run it?

如果,然后是Eclipse构建不同的,因为Java编译器实现了Java语言规范来构建类?但下面的的Apache Maven的链接说,默认的编译器是javax.tools。 JavaCompiler的(顺便说一句,我使用Java 1.6)。

If No, then is Eclipse build different because the Java compiler implements the Java Language Specification to build the classes? But the following Apache Maven link says that the default compiler is javax.tools.JavaCompiler (By the way I am using Java 1.6).

推荐答案

我想我可能已经找到了答案,我的问题。首先,我想说说我有 M2E(Maven插件为Eclipse)安装在我的STS。我跟我的一个同事,他认为他们都是同样的事情(建设项目和MVN编译)。刷新项目STS运行后MVN干净安装应足以运行项目。但是有些时候,他只是一个刷新执行过程中运行到异常。只有那时,他执行的刷新生成项目,然后的运行即可。他说,这可能是STS有时需要构建一个错误。

I think I may have found an answer to my question. Firstly I'd like to say that I do have the M2E (Maven plugin for Eclipse) installed in my STS. I spoke to a colleague of mine and he agreed that they are both the same thing (Build Project and the "mvn compile"). Refreshing the Project in STS after running a "mvn clean install" should be sufficient to run your Project. However there are times when he runs into exceptions during execution with just a Refresh. Only then does he perform a Refresh, "Build Project" and then Run. He says it's probably a bug that STS sometimes requires a Build.

随着m2eclipse插件可以运行命令mvn全新安装两种方式,直接从您的Eclipse命令:结果
1.右键单击你的Maven项目>运行方式> [选择你的Maven命令]结果
2.右键点击你的Maven项目>运行作为你的pom.xml> [选择你的Maven命令]

With the M2Eclipse plugin you can run your "mvn clean install" command directly from your Eclipse in two ways:
1. Right click on your Maven Project> Run As> [Select your maven command]
2. Right click on your pom.xml in your Maven Project> Run As> [Select your maven command]

我仍然运行$ maven的p $ PFER通过命令行命令虽然。 :)

I still prefer running the maven commands through command line though. :)

这篇关于Eclipse的区别构建项目和Maven编译命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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