[jboss-user] [JBoss Tools] - Use JBoss Tools with Google GWT Plugin
do-not-reply at jboss.com
Thu Jul 15 08:33:22 EDT 2010
Andre Dietishei [http://community.jboss.org/people/adietish] modified the document:
"Use JBoss Tools with Google GWT Plugin"
To view the document, visit: http://community.jboss.org/docs/DOC-15593
h1. A few simple steps
If you develop web applications with GWT you most likely end up using Eclipse and the Google Plugins for Eclipse. These Plugins offer to run your application on a jetty instance. If you want to use JBoss instead, JBoss Tools allows you to define a war project archive and make sure it gets published to the JBoss instance of your choice. This allows you to use Google GWT plugins proprietary project layout and Eclipse integration together with JBoss servers.
Note: We are working on getting Google GWT Plugin to be a better Eclipse citizen, but for now this will have to do ;)
The google web toolkit, GWT is a nice framework to develop web applications. Google even delivers a plugin for Eclipse so that developing with GWT is a very pleasant experience. The GWT plugin uses an embedded jetty to run the application that you develop. Google unfortunately did not use standard Eclipse project structure for web projects. So if you want to use JBoss instead of jetty, the approach to take is not as intuitive as it could be. This article shows you what steps to take so that you can develop your GWT application seamlessly with JBoss Tools while running on JBoss.
This How-To shows all the steps to install the plugins and how to configure it with Project Archives.
h2. Install Google Plugin for Eclipse
Install the Google plugin for Eclipse in your Eclipse or JBoss Developer Studio (3.x) by adding the following update site:
> http://dl.google.com/eclipse/plugin/3.5 http://dl.google.com/eclipse/plugin/3.5
You can use the Google GWT plugin i http://code.google.com/eclipse/docs/getting_started.html#installing nstallation guide to see the exact instructions.
h2. Create a Web Application Project
In order to get the support you need for GWT projects, you'll need to create a new *Web Application Project*. You may do so with the toolbar or with entries in the file menu.
Notice that here we deselect "Use Google App Engine" since that is not needed for this example.
h2. Create a new WAR with Project Archives
We'll work with a JBoss application server instead of the embedded jetty that's provided with the Google plugins. We therefore need to provide JBoss with a *War Archive* that bundles your project resources. The *Project archives* view allows you to do so. Select your GWT project and go to the *Project archives* view. You can now define a new war archive by right clicking on the project name.
The wizard that pops up allows you pick an archive name, the path at which it'll be created and the type (packed or unpacked). Choose the settings that fit your needs.
The wizard created a default fileset, that determines what project files shall be included in the war. We'll replace it by a fileset that includes all files within the *war* directory. This is the location the google plugins compile and package the code to.
Your war archive shows up in the *Project archives* as soon you hit *finish*.
h1. Build and publish your war
We now need to publish the War to the JBoss instance. Choose the appropriate entry in the context-menu of your war-archive and hit *Edit publish settings*.
JBoss Developer Studio comes with a preconfigured server named jboss-eap. You therefore already get that server in the list of the available servers.
If you use plain JBoss Tools you would need to setup the server manually.
Select the server and choose to publish to it in the way that fits your needs:
Your war now's assiociated to your server and will be published to it if your GWT project's been built. The *Servers* view show you the state of the publishing:
h2. Cross compile
The Google cross compiler will inform you in the console view whether's he succeeded in his job. Check the output and wait until it terminated its compilation task.
h2. *Launch your Browser*
The project archive we created was deployed to the base url *gwt-jboss*. The jBoss server that's included in the JBoss developer studio is configured (by default) to run on port *8080*. Your application's therefore accessible at the url:
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html
h2. Speed up my development cycle!
h2. Launch Google
Create a *Web Application* launch configuration for that matter.
We want to use our JBoss instance, we therefore disable the embedded jetty that's provided by the GWT plugins.
Now that we want not to cross-compile on each change, we'll need to tell the google browser-plugin where to fetch the code from. We do that by adding an url parameter:
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html*?gwt.codesvr=127.0.0.1:9997*
To convince yourself that there's no cross compilation needed any more, go to the client-package and change any java class that's in there. You may for instance change the label of a button and reload your browser (without launching the google cross-compiler).
There you go, now you can use JBoss Tools and JBoss Developer Studio together with Google GWT plugin to do full deployment (with Cross Compile) or development mode via the hosted mode option.
All enabled by utilizing the Project Archives view.
Comment by going to Community
Create a new document in JBoss Tools at Community
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jboss-user