eclipse 导入 Maven-GWT 项目时出错(“没有找到处理 gwt-maven-plugin 的市场条目”)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7916308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:38:03  来源:igfitidea点击:

Error when importing Maven-GWT project ("No marketplace entries found to handle gwt-maven-plugin")

eclipsegwtmaven

提问by Dave

I'm using Eclipse Indigo on Win XP, Maven 3.0.3 and GWT 2.4. I created a Maven-GWT project using the Mavne gwt archetype. Then I opened Eclipse, went to File -> Import, selected Existing Maven Projects, chose the pom for my GWT-Maven project, and then got this dialog:

我在 Win XP、Maven 3.0.3 和 GWT 2.4 上使用 Eclipse Indigo。我使用Mavne gwt archetype. 然后我打开 Eclipse,转到File -> Import,选择Existing Maven Projects,为我的 GWT-Maven 项目选择 pom,然后得到这个对话框:

enter image description here

在此处输入图片说明

The errors are

错误是

No marketplace entries found to handle gwt-maven-plugin:2.4.0:generateAsync in Eclipse.  Please see Help for more information.
No marketplace entries found to handle gwt-maven-plugin:2.4.0:i18n in Eclipse.  Please see Help for more information.
No marketplace entries found to handle maven-war-plugin:2.1.1:exploded in Eclipse.  Please see Help for more information.

Anyone know how to resolve these errors? It is wreaking havoc when I actually import my project and try and work with it. - Dave

有谁知道如何解决这些错误?当我实际导入我的项目并尝试使用它时,这会造成严重破坏。- 戴夫

回答by Gob00st

Make sure you are not using the embedded Maven of Eclipse.

确保您没有使用 Eclipse 的嵌入式 Maven。

Go to Window->Preference ->Maven -> Installation->choose your own maven installation folder there.

去那里Window->Preference ->Maven -> Installation->选择你自己的 maven 安装文件夹。

EDIT

编辑

If your company pays for IDE, you should ask for IntelliJ the IDE for Java, which I would say is better than Eclipse in many ways, not saying Eclipse is not good, that's just a good alternative. And you won't have this issue to start with

如果您的公司为 IDE 付费,您应该要求IntelliJ IDE for Java,我会说它在很多方面都比 Eclipse 好,不是说 Eclipse 不好,这只是一个不错的选择。你不会有这个问题开始

回答by Chinthaka Dinadasa

If your pom is not specific as to the version of the maven-resources-plugin, that version will come from the superpom. By default, m2e uses an embedded copy of Maven 3.0.x. If the superpom there points to 2.4.3 and your 'outside-of-Eclipse' version asks for something else, then the Maven inside of Eclipse will go looking for 2.4.3 and fail due to the 'offline'.

如果您的 pom 不是特定于 maven-resources-plugin 的版本,则该版本将来自 superpom。默认情况下,m2e 使用 Maven 3.0.x 的嵌入式副本。如果那里的 superpom 指向 2.4.3 并且您的“外部 Eclipse”版本要求其他内容,那么 Eclipse 内部的 Maven 将寻找 2.4.3 并由于“离线”而失败。

Fix by configuring m2e to use the Maven installation you are using outside, or turning off 'offline' for one build.

通过将 m2e 配置为使用您在外部使用的 Maven 安装或关闭一个构建的“离线”来修复。

If you want to use maven from your local installation instead of the embedded version that comes with m2e, You have to do this

如果您想从本地安装使用 maven 而不是 m2e 附带的嵌入式版本,您必须这样做

Windows ==> Preferences ==> Maven ==> Installations ==> Click Add (select your local maven installation directory)

Installation Directory is not where local repository. It is where maven is installed.

安装目录不是本地存储库所在。这是安装maven的地方。

After changing try right click on project then,

更改后尝试右键单击项目,然后,

Maven ----> Update Project

Maven ----> 更新项目

回答by Udit Kumawat

This helped me:

这帮助了我:

  1. Delete the project from eclipse (but don't delete from disk)
  2. Close eclipse
  3. In your user folder there is .m folder.
  4. Delete repository folder underneath it (.m/repository).
  5. Open eclipse Import project as existing maven project (from disk).
  1. 从 eclipse 中删除项目(但不要从磁盘中删除)
  2. 关闭日食
  3. 在您的用户文件夹中有 .m 文件夹。
  4. 删除它下面的存储库文件夹 (.m/repository)。
  5. 打开 eclipse 导入项目作为现有的 Maven 项目(从磁盘)。

回答by Daniel Kurka

I am using a different approach with maven, gwt and eclipse.

我对 maven、gwt 和 eclipse 使用了不同的方法。

I am using the maven eclipse plugin to generate a .classpath and .project file and import the project manually into eclipse (not as a maven project).

我正在使用 maven eclipse 插件生成一个 .classpath 和 .project 文件,并手动将项目导入 eclipse(而不是作为 maven 项目)。

My configuration for the maven eclipse plugin looks like this:

我的 maven eclipse 插件配置如下所示:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.8</version>

            <configuration>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>false</downloadJavadocs>
                <buildOutputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</buildOutputDirectory>
                <projectnatures>
                    <projectnature>org.eclipse.jdt.core.javanature</projectnature>
                    <projectnature>com.google.gdt.eclipse.core.webAppNature</projectnature>

                    <nature>com.google.gwt.eclipse.core.gwtNature</nature>
                </projectnatures>
                <buildcommands>
                    <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
                    <buildcommand>com.google.gdt.eclipse.core.webAppProjectValidator</buildcommand>

                    <buildcommand>com.google.appengine.eclipse.core.projectValidator</buildcommand>
                    <buildcommand>com.google.gwt.eclipse.core.gwtProjectValidator</buildcommand>
                </buildcommands>
                <classpathContainers>
                    <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>

                    <classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer>
                </classpathContainers>
                <excludes>
                    <exclude>com.google.gwt:gwt-servlet</exclude>
                    <exclude>com.google.gwt:gwt-user</exclude>
                    <exclude>com.google.gwt:gwt-dev</exclude>
                    <exclude>javax.validation:validation-api</exclude>
                </excludes>
                <linkedResources>
                    <linkedResource>
                        <name>war</name>
                        <type>2</type>
                        <location>${basedir}/target/${project.artifactId}-${project.version}</location>
                    </linkedResource>
                </linkedResources>

            </configuration>
        </plugin>

Hope that helps

希望有帮助