开发者

How can I run a GWT app from gwt-maven-plugin without any browser plugins?

开发者 https://www.devze.com 2023-03-31 20:59 出处:网络
For a GWT application which I build with the GWT Maven Pl开发者_开发知识库ugin (gwt-maven-plugin), I can run the GWT Developmentenvironment with

For a GWT application which I build with the GWT Maven Pl开发者_开发知识库ugin (gwt-maven-plugin), I can run the GWT Development environment with

mvn compile war:exploded gwt:run

and then launch a browser. This requires that the browser provides the GWT Developer Plugin. (Firefox 6 for example does not yet support the GWT Plugin).

Does the GWT Maven Plugin also allow to simply run the included Jetty container with the GWT application, without a development mode?


After configuring gwt-maven plugin you could simply run the following.

mvn jetty:run-war

After gwt compilation the resulting war will be placed in jetty and started via Maven Jetty Plugin.


The only way to run the project without plugin is to compile it and run on a server. If you are using Netbeans just hit run. The IDE will compile and deploy project on a server. In other way just compile it with the following command (you can omit tests and reports):

mvn clean:clean resources:resources compiler:compile war:exploded resources:testResources compiler:testCompile surefire:test gwt:compile war:war

After this you 've got ready to deploy war file. To deploy it to the Glassfish there are now basically three options:

Maven GlassFish Plugin

A first option would be to use the Maven GlassFish Plugin. This plugin allows to interact with a local or remote GlassFish install and the management of Glassfish domains and component deployments from within the Maven build lifecycle.

Maven Embedded GlassFish Plugin

The second option would be to use the Maven Embedded Glassfish Plugin. As stated by its name, this plugin doesn't rely on an existing install but uses an embedded GlassFish, running in the same JVM as the plugin. This plugin is extremely nice if you want to keep your build portable (anybody can get your POM and run a build involving GlassFish without having it installed) with almost the same features as a normal GlassFish install, except clustering of course (you can use a preconfigured domain.xml if you want). See Testing with the GlassFish Maven plugin and JavaDB Embedded for an example.

Maven Cargo Plugin

The work initiated by Kohsuke Kawagushi as been finally integrated in Cargo and, starting with Cargo 1.0.1, GlassFish 3.x is now supported. Using the Maven Cargo plugin is thus a third option. This would be interesting for builds that want to interact with containers in an agnostic way. But I'm not sure Cargo allows all the flexibility of the GlassFish specific plugin(s) (e.g. deployment of JMS resources, etc).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号