简体   繁体   English

在eclipse中安装maven并创建maven项目

[英]Installing Maven and creating a maven project in eclipse

I am new to using maven project and i am trying to create a maven project and i followed the instructions to create one in eclipse and i gave the groupId and artifact id to it and clicked Finish, for which it gave me an error stating我是使用 maven 项目的新手,我正在尝试创建一个 maven 项目,我按照说明在 eclipse 中创建了一个项目,我给了它 groupId 和 artifact id 并单击 Finish,为此它给了我一个错误说明

"No marketplace entries found to handle maven-compiler-plugin:3.1:compile in Eclipse. Please see Help for more information." “没有找到处理 maven-compiler-plugin:3.1:compile 在 Eclipse 中的市场条目。请参阅帮助以获取更多信息。”

For this issue i tried googling and stack overflow and i saw people asking other people to change the installation directory of maven inside对于这个问题,我尝试使用谷歌搜索和堆栈溢出,我看到有人要求其他人更改里面的 maven 安装目录

Window-> Preferences -> Maven-> Installation窗口-> 首选项-> Maven-> 安装

I tried that and tried to update the maven project but still i have some errors, i am not able to setup my project, Could someone please help?我尝试过并尝试更新 maven 项目,但仍然有一些错误,我无法设置我的项目,有人可以帮忙吗? I am attaching the errors herewith.我在此附上错误。 在此处输入图片说明

If a Maven project is configured to use ecj compiler, the following errors appear when importing the project into eclipse:如果Maven项目配置为使用ecj编译器,在将项目导入eclipse时出现如下错误:

  • No marketplace entries found to handle maven-compiler-plugin:2.3.2:compile in Eclipse.没有找到处理 Eclipse 中的 maven-compiler-plugin:2.3.2:compile 的市场条目。 Please see Help for more information.请参阅帮助以获取更多信息。

  • No marketplace entries found to handle maven-compiler-plugin:2.3.2:testCompile in Eclipse.没有找到在 Eclipse 中处理 maven-compiler-plugin:2.3.2:testCompile 的市场条目。 Please see Help for more information.请参阅帮助以获取更多信息。

A fix should be trivial.修复应该是微不足道的。

http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.jdt/lifecycle-mapping-metadata.xml reads: http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.jdt/lifecycle-mapping-metadata.xml读取:

    <parameters>
      <compilerId>javac</compilerId>
    </parameters>

It should read:它应该是:

    <parameters>
      <compilerId>javac</compilerId>
      <compilerId>eclipse</compilerId>
    </parameters>

Reproducible: Always可重现:始终

Steps to Reproduce: 1. Unpack example zip provided 2. Try to import it to Eclipse: File->Import->Maven->Existing Maven Projects重现步骤: 1. 解压提供的示例 zip 2. 尝试将其导入 Eclipse:File->Import->Maven->Existing Maven Projects

First you can try to install maven globaly.首先你可以尝试安装maven globaly。 follow the steps.按照步骤。

  1. Download maven from maven download linkmaven 下载链接下载 maven

  2. Create or export M2_HOME="MAVEN ROOT LOCATION".创建或导出 M2_HOME="MAVEN ROOT LOCATION"。 Ex.前任。 : E:\\SoftwareRepo\\building tools\\apache-maven-3.5.2 : E:\\SoftwareRepo\\building tools\\apache-maven-3.5.2

  3. Create or export MAVEN bin folder location to PATH variable.创建或导出 MAVEN bin 文件夹位置到 PATH 变量。 For example: E:\\SoftwareRepo\\building tools\\apache-maven-3.5.2\\bin例如: E:\\SoftwareRepo\\building tools\\apache-maven-3.5.2\\bin

  4. Open terminal or cmd and run mvn --version to confirm maven is installed or not.打开终端或 cmd 并运行mvn --version以确认是否安装了 maven。

Then go to eclipse.然后去日食。 and setup project.follow this steps并设置项目。请按照以下步骤操作

  1. Import existing maven project or create a maven project导入现有的 Maven 项目或创建一个 Maven 项目
  2. Goto project explorer and Right click on your pom.xml转到项目资源管理器并右键单击您的 pom.xml
  3. then select Run As maven install.然后选择 Run As maven install。
  4. and then what you want.然后你想要什么。

Hope it will serve your purpose.希望它能达到你的目的。 You can download a sample spring boot project from sample spring boot project您可以从示例 spring boot 项目下载示例 spring boot 项目

Or you can run a maven project from terminal or cmd.或者您可以从终端或 cmd 运行 Maven 项目。 Just goto project root folder and then run a maven task like maven clean install .只需转到项目根文件夹,然后运行 ​​maven 任务,如maven clean install Happy Coding :)快乐编码:)

在此处输入图片说明

You can check the below video link in that, I have explained the installation process from scratch. 您可以检查下面的视频链接,我已经从头开始解释了安装过程。

Maven Installation on Microsoft Windows 在Microsoft Windows上进行Maven安装

First install Java and then create the maven project.首先安装Java ,然后创建maven项目。

Install the stable Java version in the system.在系统中安装稳定的Java版本。

If Java is not installed then these types of errors will be displayed.如果未安装Java ,则会显示这些类型的错误。

No marketplace entries found to handle maven-compiler-plugin:3.1:compile in Eclipse.没有找到在 Eclipse 中处理 maven-compiler-plugin:3.1:compile 的市场条目。

Take a look at Help for more information.查看Help以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM