Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Eclipse中使用GWT+Maven项目_Eclipse_Gwt_Maven - Fatal编程技术网

在Eclipse中使用GWT+Maven项目

在Eclipse中使用GWT+Maven项目,eclipse,gwt,maven,Eclipse,Gwt,Maven,我在创建一个简单的GWT+Maven项目时遇到了很多问题,这个项目可以在Eclipse中使用。以下是我正在做的: 创建一个新的gwt maven插件项目: 在Eclipse中打开项目:文件=>Import…=>现有Maven项目,然后选择我刚刚创建的项目 但是,我发现以下错误: No marketplace entries found to handle gwt-maven-plugin:2.5.0-rc2:generateAsync in Eclipse. Please see Help f

我在创建一个简单的GWT+Maven项目时遇到了很多问题,这个项目可以在Eclipse中使用。以下是我正在做的:

创建一个新的gwt maven插件项目:

在Eclipse中打开项目:文件=>Import…=>现有Maven项目,然后选择我刚刚创建的项目

但是,我发现以下错误:

No marketplace entries found to handle gwt-maven-plugin:2.5.0-rc2:generateAsync in Eclipse. Please see Help for more information. No marketplace entries found to handle gwt-maven-plugin:2.5.0-rc2:i18n in Eclipse. Please see Help for more information. 我不明白这个错误信息。我找到了一个,但将建议的剪贴添加到pom.xml中似乎没有任何作用


有人能解释一下吗?

不要从命令行运行,而是安装eclipse Maven Integration for eclipse插件。这会让你的生活轻松很多


更新:查看这一条

您应该告诉m2e忽略这些警告。一旦执行了一个目标,async和i18n目标就会自动执行,这只是maven/eclipse不配合的一个典型例子

在项目的构建部分中,将pluginManagement附加到plugins元素之后

   <plugins>
          your  maven plugins here
    </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>
                                            gwt-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.4.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>i18n</goal>
                                            <goal>generateAsync</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

最后,将target/generated sources/gwt文件夹添加到构建路径中

m2e在让Maven和Eclipse进行对话方面做得非常巧妙显然,OP已经在使用M2Eclipse了:没有找到市场条目……某种消息来自m2e。@eugener-我从命令行使用mvn只是为了创建一个简单的示例项目我在尝试将任何Maven+GWT项目导入安装了m2e的Eclipse时遇到问题。您尝试过该项目吗→ 专家→ 更新项目配置?顺便说一句,我不建议使用原型。请参阅更新项目配置未解决问题。你链接的教程看起来很有前途,我来试试。Eclipse不建议你快速修复这些错误吗?它应该建议您忽略它们,为此,它将在POM的插件管理部分插入与Dvd Prd答案类似的适当配置。@ThomasBroyer Thomas,《与Maven合作指南》建议使用starter POM配置,但所有POM都使用请求工厂。是否有更精简的pom为RPC GWT应用程序提供最基本的必需品?在许多其他方面。我几乎可以肯定一些示例使用RPC,尽管验证可能?这会删除这两个导入错误,但随后我得到一系列涉及缺失类型的生成错误:消息无法解析为类型,GreetingServiceAsync无法解析为类型,类型GWT中的方法createClass引用缺失类型消息,等等。确保将目标/生成的源/gwt文件夹添加到构建路径。这将使eclipse找到生成的类。
   <plugins>
          your  maven plugins here
    </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>
                                            gwt-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.4.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>i18n</goal>
                                            <goal>generateAsync</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>