gpt4 book ai didi

eclipse - 在 Eclipse 中运行 GWT-Maven 项目时遇到问题 - 无法在类路径中找到 'com/myco/clearing/product/ProductPlus.gwt.xml'

转载 作者:行者123 更新时间:2023-12-02 10:33:12 24 4
gpt4 key购买 nike

我在 Win XP、Maven 3.0.3 和 GWT 2.4 上使用 Eclipse Indigo。我创建了一个 GWT-Maven 项目并按照此处的说明将其导入 Eclipse -- http://mojo.codehaus.org/gwt-maven-plugin/user-guide/archetype.html 。添加额外的源文件夹(target/generated-sources/gwt,说明中未提及的步骤)后,我右键单击我的项目,选择“运行方式”->“Web 应用程序”并收到此错误.. .

Loading modules
com.myco.clearing.product.ProductPlus
[ERROR] Unable to find 'com/myco/clearing/product/ProductPlus.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method

您对如何配置 Eclipse 来解决这个问题有什么想法吗?除了我提到的步骤之外,我没有做任何其他事情。

.gwt.xml 文件由原型(prototype)创建,位于 src/main/resources/war 目录中。其内容为

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ProductPlus'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />

<!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' />

<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

<!-- Other module inherits -->

<!-- Specify the app entry point class. -->
<entry-point class='war.client.ProductPlus' />

<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />

</module>

谢谢,-戴夫

最佳答案

尝试使用 m2Eclipse 运行您的应用程序...因为您的应用程序是 Maven 化的,所以您在尝试使用 GWT Eclipse 插件运行它时可能会遇到麻烦。我所做的是:

  • 右键单击您的项目文件夹
  • 选择“运行方式 > Maven 构建...
  • 这将允许您创建新的运行配置。如果你只想运行应用程序,只需将 gwt:run 添加到您的目标即可。如果你想 build 然后运行,将clean install gwt:run之类的内容添加到您的目标中。

也许这也会有帮助: - 确保在项目 > 属性 > Google > Web Toolkit 中,选中“使用 Google Web Toolkit”复选框(这会自动将生成的文件夹添加到您的类路径中)。 - 检查 Eclipse 是否知道这是一个 Maven 项目。如果是,您应该有一个名为“Maven Dependencies”的文件夹。如果不是,请右键单击您的项目,选择配置 > 转换为 Maven 项目

关于eclipse - 在 Eclipse 中运行 GWT-Maven 项目时遇到问题 - 无法在类路径中找到 'com/myco/clearing/product/ProductPlus.gwt.xml',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7971851/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com