GWT Maven Plugin - gwt:run works,但gwt:compile不会。为什么? [英] GWT Maven Plugin -- gwt:run works but gwt:compile doesn't. Why?

查看:117
本文介绍了GWT Maven Plugin - gwt:run works,但gwt:compile不会。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用gwt-maven-plugin来管理GWT项目。我一直使用 gwt:run 目标在dev模式下本地运行以进行测试。我现在想要将我的项目编译成部署在Tomcat上的战争。但是,当我运行 gwt:compile 时,会出现编译错误,指出类路径配置问题。一个例子:

pre $ code找到入口点类
[错误]'shared.MyClass.java'中的错误
[错误]第4行:导入server.model.MyObject无法解析

任何想法?我是否需要手动将服务器包添加到某个配置文件中?感谢您提供任何信息。



-tjw

解决方案

好的,我发现了这个问题。我在GWT论坛上发现了这个问题(GWT开发者):
$ b


我的意思是你必须使用javac类,从
注释引用(在这种情况下,从
@WithTokenizers引用的PlaceTokenizer类;对于您的服务,域对象,
定位器或服务也是如此定位器与RequestFactory,除非您使用
@ServiceName和@ProxyForName)。否则,GWT只能使用
* .java文件,不带* .class。

我试图因为它们与RequestFactory一起使用,所以从这些类中加载注释。我的问题是现在这个:这个限制是不是完全疯了?

I'm using gwt-maven-plugin to manage a GWT project. I use the gwt:run goal all the time to run locally in "dev mode" for testing. I now want to compile my project into a war for deployment on Tomcat. When I run gwt:compile, however, I get compile errors that indicate a classpath configuration issue. An example:

Finding entry point classes
[ERROR] Errors in 'shared.MyClass.java'
[ERROR] Line 4: The import server.model.MyObject cannot be resolved

Any ideas? Do I need to manually add the server package to some config file somewhere? Thanks in advance for any info.

-tjw

解决方案

Ok, I found the problem. I found this in the GWT forums by Thomas Broyer (a GWT dev):

I mean you have to "javac" classes that are referenced from annotations (in this case, the PlaceTokenizer classes referenced from @WithTokenizers; that'd be true also of your service, domain object, locator or service locator with RequestFactory, unless you use @ServiceName and @ProxyForName). Otherwise, GWT can work with only the *.java files, without the *.class.

I am trying to load in these classes from annotations since they are used with RequestFactory. My question is now this: How is this restriction not completely insane?

这篇关于GWT Maven Plugin - gwt:run works,但gwt:compile不会。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆