gwt-eclipse-plugin icon indicating copy to clipboard operation
gwt-eclipse-plugin copied to clipboard

Eclipse Project => Deployment Assembly or Equivalent for GWT Web Application?

Open gwtuser opened this issue 9 years ago • 2 comments

This issue was originally filed under gwt rather than the gwt-eclipse-plugin, so recreating here:

We use Eclipse for GWT development. We have several existing projects that are defined as GWT Web Applications and are run via the GWT Plugin in either Super or Classic Dev Mode. We've found a problem which is that our project build path (.classpath) refers to JARs at various locations outside the WEB-INF/lib directory, but running (Super)DevMode via the plugin doesn't copy those JARs to WEB-INF/lib. The result is that the app fails out with ClassNotFound exceptions.

In a "normal" Eclipse Java Project, say one defined as a "Dynamic Web Module," you can configure part of the project properties called "Deployment Assembly" to copy the JARs you want to WEB-INF/lib. Indeed, if I define and run the GWT CodeServer separately, and deploy the app to Tomcat or Jetty manually using a Dynamic Web Module project I can solve it that way.

However, I'd like to use the built-in jetty server for GWT SDM since that's what our customers will do. How can I achieve what I need? Obviously, the files can be copied by hand in the OS, and that's what we do now, but I'd like a better solution. I'm also aware that Maven and/or IvyDE have the potential to solve this, but I'm not interested in adding Maven or Ivy to the equation just to solve this issue.

Can someone tweak the GWT Plugin source defining a Web Application to enable "Deployment Assembly," and make sure it's triggered when the GWT Plugin is used to run (Super)DevMode?

Note, I've already tried manually adding the appropriate configuration to the .classpath XML file that gets added when you tinker with the Deployment Assembly page, but it doesn't work. I assume this is because the "run" button of the GWT Plugin doesn't trigger the critical logic that reads and acts upon the extra .classpath config data. This critical logic, however, clearly does run if you tell Eclipse to deploy a Dynamic Web Module to Tomcat (for example).

Thanks.

gwtuser avatar Feb 05 '16 08:02 gwtuser

I responded to the post in GWT too. I help out on the plugin. Currently classic dev mode doesn't copy the dependent library or transitive libraries that have been added to the classpath. Typically this is done with a build task or built in IDE feature. Currently this IDE feature can be done with the WTP system, which means you can use facet configurations to enable features on in the project to which add behaviors like moving libs to the webapp lib directory. This plugin does support using server runtimes, which have the ability to enable facets, and uses the code server to run the gwt compiling. Since there isn't a built in way to chain launchers, another launcher could be setup to copy the libs. The best way I like to do this task is using maven and Eclipse uses m2e to detect the build task and m2e will be activated to move the libs. So there are ways to do it.

On the other hand I get what you're saying, and sounds like a nice enhancement to be able to trigger the copy of libs with the code server. I can add this as a future enhancement. Although I don't think I can get to it soon. I've got another high priority items at the moment that are consuming my time with this project but a couple few more months and I should be past them.

branflake2267 avatar Feb 05 '16 17:02 branflake2267

Just a note, I forgot to mention, IDEA does have an option to run build tasks during the launch.

branflake2267 avatar Feb 05 '16 17:02 branflake2267