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

时间:2011-10-27 13:09:26

标签: eclipse gwt maven

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

enter image description here

错误是

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.

任何人都知道如何解决这些错误?当我实际导入我的项目并尝试使用它时,它正在肆虐。 - 戴夫

5 个答案:

答案 0 :(得分:21)

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

转到Window->Preference ->Maven -> Installation->选择您自己的maven安装文件夹。

新编辑:如果您的公司为IDE付费,您应该要求IntelliJ IDE for Java,https://www.jetbrains.com/idea/我会说在很多方面比Eclipse更好,而不是说Eclipse不好,那只是一个好的选择。你不会有这个问题开始:)

答案 1 :(得分:5)

如果你的pom没有具体的maven-resources-plugin版本,那么该版本将来自superpom。默认情况下,m2e使用Maven 3.0.x的嵌入式副本。如果那里的superpom指向2.4.3并且你的'Eclipse之外'版本要求其他东西,那么Eclipse里面的Maven将会寻找2.4.3并因为'离线'而失败。

通过配置m2e以使用您在外部使用的Maven安装或关闭一个版本的“离线”进行修复。

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

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

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

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

  

Maven ---->更新项目

答案 2 :(得分:2)

答案 3 :(得分:0)

我正在使用与maven,gwt和eclipse不同的方法。

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

我对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>

希望有所帮助

答案 4 :(得分:0)

这对我有所帮助:

  1. 从eclipse中删除项目(但不要从磁盘中删除)
  2. 关闭eclipse
  3. 在您的用户文件夹中有.m文件夹。
  4. 删除它下面的存储库文件夹(.m / repository)。
  5. 打开eclipse导入项目作为现有的maven项目(来自磁盘)。