GWT Maven Plugin — gwt:run works but gwt:compile doesn't. Why?

此生再无相见时 提交于 2020-01-01 05:50:28

问题


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


回答1:


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?



来源:https://stackoverflow.com/questions/8766556/gwt-maven-plugin-gwtrun-works-but-gwtcompile-doesnt-why

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!