I have the widgetset compiled with the Maven goals: vaadin:update-widgetset gwt:compile. So the pom.xml and web.xml files configurations should be fine.
I'm a Maven newbie and this is my first Maven project.
After compilation the compiled code shows in src/main/webapp/VAADIN/widgetsets folder. When I try to run the install goal the error shows:
Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.2.0:resources (default) on project Validation-Manager-Web: GWT Module com.pantar.widget.graph.GraphWidget not found in project sources or resources.
Just in case here are the relevant files:
POM:
<plugins>
<!-- Compiles your custom GWT components with the GWT compiler -->
<!-- A hosted mode browser for client-side widget debugging can be run with the goal gwt:run after uncommenting the
correct line below. A remote debugger can then be connected to port 8998. Note that e.g. a Jetty server should be running
with the server side parts - use the goal jetty:run . -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.plugin.version}</version>
<configuration>
<!-- if you don't specify any modules, the plugin will find them -->
<modules>
<module>com.pantar.widget.graph.GraphWidget</module>
</modules>
<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
<!-- On Mac running Snow Leopard, add "-d32" -->
<!-- This causes error messages (but build works) in phase "package": two processes would use the same debug
port -->
<!--extraJvmArgs>-Xmx512M -Xss1024k -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8998</extraJvmArgs -->
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<runTarget>Validation-Manager-Web</runTarget>
<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
<noServer>true</noServer>
<port>8084</port>
<compileReport>false</compileReport>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>1.0.2</version>
<executions>
<execution>
<configuration>
<modules>
<module>com.pantar.widget.graph.GraphWidget</module>
</modules>
</configuration>
<goals>
<goal>update-widgetset</goal>
</goals>
</execution>
</executions>
</plugin>
Any ideas?
Thanks in advance!
Fixed it by adding an empty gwt.xml file with this contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
<inherits name="<module>" />
</module>
Related
My project uses Maven to reference all needed libraries, so I don't even need to manually install robot framework (I just included markusbernhardt's Selenium2Library as a dependency in pom.xml):
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.7</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
I can run my tests as Maven Install or using a Run Configuration for Maven:
However, I don't know how to tell robot framework that I want to run tests tagged with certain tags. I don't run robot framework from a command line as I don't have robot framework installed in my machine, I'm only using it as a maven dependency, so I can't run python -m robot.run --include tag.
I tried adding --include tag as a Parameter in the Run Configuration but it's being ignored.
Is there a way to send this tag parameter to robot within Eclipse?
Just found out how! Leaving info here in case it helps someone else:
It's all in pom.xml:
Add a <properties />first-level element (within <project />) with a property name of your choosing and the tag you want to run, like this:
<properties>
<robot-tag>mytag</robot-tag>
</properties>
Then, in the plugins section, within the robotframework-maven-plugin plugin
element, add this:
<configuration>
<includes>
<include>${robot-tag}</include>
</includes>
</configuration>
That's it. The Run Configuration doesn't need to be changed. And the project can also be ran as Maven Install.
This is what my pom.xml looks like now (stripping out the element and project-specific info like groupID, artifactID, etc):
<properties>
<robot-tag>debug</robot-tag>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.7</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>${robot-tag}</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
After updating my source code I currently have to manually execute two actions:
Update my maven projects with Alt+F5 (this overrides the Eclipse project settings with corresponding settings from the pom.xml files, e.g. udpates the classpath files)
Run my main pom.xml file with a maven run configuration (this executes all plugins of the pom.xml file)
Is there a way to
automatically execute a run configuration after updating m2e projects? or
include an m2e project update in a run configuration or
write an ant file to execute both, the m2e project update and the maven build or
adapt the m2e plugin to not just update the Eclipse settings but execute all plugins of the pom.xml file (I use packaging pom, not jar) ?
If I export my run configuration for the maven build it looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="clean install "/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
<stringAttribute key="M2_PROFILES" value=""/>
<listAttribute key="M2_PROPERTIES"/>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="true"/>
<intAttribute key="M2_THREADS" value="4"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value="../PowerShare/maven_settings.xml"/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dmaven.multiModuleProjectDirectory="/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:PowerTools}"/>
</launchConfiguration>
Here is an example main pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- HEADER **************************************************************************************************************** -->
<modelVersion>4.0.0</modelVersion>
<groupId>isi.power.tools</groupId>
<artifactId>PowerTools</artifactId>
<version>0.0.1-SNAPSHOT</version> <!-- is available as variable ${project.version} -->
<packaging>pom</packaging>
<!-- CUSTOM PROPERTIES ***************************************************************************************************** -->
<properties>
<!-- set encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<!-- RESOURCES *********************************************************************************************************** -->
<resources>
<resource>
<!-- add java source folder as resource to copy fxml files -->
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<!-- enable replacement of variable place holders with values, e.g. to include version information -->
<filtering>true</filtering>
</resource>
</resources>
<!-- PLUGINS ************************************************************************************************************** -->
<plugins>
<!-- ### RESOURCES ### phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>resource-execution</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- ### COMPILE ### phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<!-- specify current java version here: -->
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<id>compile-execution</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>isi.power.ace.test-compile-execution</id>
<phase>isi.power.ace.test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- ### PACKAGE ### phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>package-execution</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- ### INSTALL ### phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-execution</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
<execution>
<id>install-file-execution</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>isi.power.tools</groupId>
<artifactId>PowerTools</artifactId>
<version>${project.version}</version>
<packaging>jar</packaging>
<file>${project.basedir}/target/PowerTools-${project.version}.jar</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- MODULES ************************************************************************************************************** -->
<modules>
<module>../PowerCluster</module>
</modules>
<!-- DEPENDENCIES ********************************************************************************************************* -->
<dependencies>
<!-- Dependencies on other workspace projects -->
<dependency>
<groupId>isi.power.share</groupId>
<artifactId>PowerShare</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>PowerACEISI_trunk</groupId>
<artifactId>PowerACEISI_trunk</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>isi.power.cluster</groupId>
<artifactId>PowerCluster</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
The answer to your question is really dependent on what plugins you're trying to execute and at what point you need them executed.
From what I know, m2e adds its own builder to your eclipse project, and it can invoke plugins you have defined in your pom.xml
That being said, eclipse's build only brings you up to the point of running "maven compile".
If you have plugins that need execution at the package phase, you will have to manually run a "maven package" configuration.
If you have plugins that execute at any phase up to "compile", they can also run in an eclipse build. However, you might need to use lifecycle-mappings to get them to actually run.
You can either do that in Eclipse settings, but I prefer to map specific plugins to my needs in the pom itself, so everyone can use it.
A mapping example:
<build>
<pluginManagement>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<versionRange>[1.0-alpha-3,)</versionRange>
<goals>
<goal>filter-sources</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
<runOnConfiguration>true</runOnConfiguration>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</pluginManagement>
</build>
this will cause the templating-maven-plugin run the filter-sources goal on every eclipse build. Note you can determine if you want the plugin executed on configuration (full) builds (after Project Clean or Maven Update), and/or on incremental builds (after editing some source code)
you can also set
<action>
<ignore />
</action>
which will cause m2e to ignore the plugin during its builds (it will still run when launching a maven run configuration)
Some plugins don't always play nicely with eclipse, for example if you need to unpack/copy a dependency you have as a project in your workspace. There are workarounds though.
Let me know if you need any more help or if I wasn't clear anywhere
I found a solution that is based on EclipseScript: http://eclipsescript.org
It requires some fine tuning but works in principle. After installing the EclipseScript plugin I created a file updateMavenProject.eclipse.js including the code below. The file can be executed with Alt+R if it is open or with Ctrl+4 (plus selection).
//This script is based on EclipseScript, see following page for more information: http://eclipsescript.org/
//Execute this script by pressing Alt+R
//This script:
// * updates the maven project (like Alt+F5 ...: apply information from pom.xml file to eclipse project settings, e.g. udpate classpath file) and
// * runs the pom.xml file as maven build (like "Run as maven build": executes all maven plugins of the pom.xml file)
// (the run configuration "updateMavenProject.eclipse.js" has to exist)
//#region SCRIPT COMMANDS
//update maven project ************
//get workbench
//var workbench = Packages.org.eclipse.ui.PlatformUI.getWorkbench();
//create maven update job
var currentProject = eclipse.resources.currentProject
var projects = [ currentProject ];
var updateMavenJob = Packages.org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob(projects);
//execute maven update job
var progressMonitor = Packages.org.eclipse.core.runtime.NullProgressMonitor();
eclipse.console.println("Updating maven project...")
updateMavenJob.runInWorkspace(progressMonitor);
eclipse.console.println("Updating maven project finished.")
//execute maven build **************
var launchConfiguration = getLaunchConfiguration("My_Maven_Run_Configuration");
var debugTools = Packages.org.eclipse.debug.ui.DebugUITools();
eclipse.console.println("Launching Maven run configuration asynchonously.")
debugTools.launch(launchConfiguration, Packages.org.eclipse.debug.core.ILaunchManager.RUN_MODE);
//show end message *****************
eclipse.window.alert("finished script. please wait until console is finished, too.");
//#end region
//#region METHODS
//
// Returns the launch configuration with the given name or null if it does not exist
//
function getLaunchConfiguration(nameOfWantedLaunchConfiguration){
var launchManager = Packages.org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager();
var launchConfiguration = null;
var launchConfigurations = launchManager.getLaunchConfigurations();
launchConfigurations.forEach(
function(currentLaunchConfiguration){
var name = currentLaunchConfiguration.getName();
//eclipse.console.println(name);
if (name.equals(nameOfWantedLaunchConfiguration)){
launchConfiguration = currentLaunchConfiguration;
}
}
);
return launchConfiguration;
}
//#end region
I am using RAD 7.5 (based on Eclipse) to generate client code from webservice WSDLs. There are actually 2 or 3 that need to be generated together to produce one client. Is there a way to automate the process of stepping through the webservice client wizard, selecting the JAX-WS binding files for all WSDLs? Ideally, this process would also create the Jar file after the Java code has been generated.
Is it possible to automate this in RAD/Eclipse?
You can use Maven with Eclipse.
There is a plugin for Maven
http://jax-ws-commons.java.net/jaxws-maven-plugin/examples/using-wsdlLocation.html
<project>
...
<dependencies>
...
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.6</version>
</dependency>
...
</dependencies>
...
<build>
...
<plugins>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<!-- Following configuration will invoke wsimport once for each wsdl. -->
<configuration>
<wsdlLocation>http://example.com/mywebservices/*</wsdlLocation>
<wsdlDirectory>src/mywsdls</wsdlDirectory>
<wsdlFiles>
<wsdlFile>a.wsdl</wsdlFile> <!-- produces wsdlLocation = http://example.com/mywebservices/a.wsdl -->
<wsdlFile>b/b.wsdl</wsdlFile> <!-- produces wsdlLocation = http://example.com/mywebservices/b/b.wsdl -->
<wsdlFile>${basedir}/src/mywsdls/c.wsdl</wsdlFile> <!-- produces wsdlLocation = /path/to/basedir/src/mywsdls/c.wsdl -->
</wsdlFiles>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
...
<build>
...
</project>
I'm trying to create a new project with Eclipse in order to create GWT application under maven 2 system.
I have create the project with the follow mvn command
mvn archetype:generate -DarchetypeRepository=repo1.maven.org -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0
I have installed the follow eclipse plugins:
* m2eclipse
* egit
* gwt plugin
Here my POM file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.mobc3.paperquid</groupId>
<artifactId>Backoffice</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>GWT Maven Archetype</name>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.3.0</gwtVersion>
<!-- GWT needs at least java 1.5 -->
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.3.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>Backoffice.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.mobc3.paperquid.backoffice.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
I can compile and deploy my application using the linux shell but I have many problems to build and run the application inside eclipse.
I haven't found any tutorial that explain how to create step by step a GWT application under maven inside eclipse.
Can someone help me?
One more option:
Make a gwt project by using the gwt plugin in Eclipse. Now you have an Eclipse gwt project.
Select the project in Project Explorer, right-click it, then choose Configure. Then select Convert to Maven Project. Now you get a gwt-maven project.
Now add necessary dependencies to pom.xml.
Here is the relevant (I think) section from my pom setup when I was running my GWT app with the gwt:run goal:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<configuration>
<runTarget>/ModuleName.html</runTarget>
<modules>
<module>${project.groupId}.package.ModuleName</module>
</modules>
<copyWebapp>true</copyWebapp>
</configuration>
<executions>
<execution>
<configuration>
<extraParam>true</extraParam>
</configuration>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
I should say, though, that I now use the GWT Eclipse Plugin to run my app within Eclipse, so it's been a while since I used this configuration. From what I remember reading, the "copyWebapp" "true" is one of the key pieces of configuration. It also helped me to specify the module name directly, because the gwt-maven-plugin sometimes had problems locating it.
I am trying to integrate GWT with SEAM. i followed the Docs and tried to run the
example as follows.
I created a GWT project, using Eclipse Galileo and created the classes as given in the example
I then added the Seam 2.0.2 jars to the build path
I compiled the application, using Google GWT Compiler using the eclipse UI.
Finally i ran the application.
First I would like to know whether the above steps are correct. After running the application I do not get the desired result.
Also is this the only way to integrate GWT with Seam ?
Update
I have got this example running using ant. But the aim of my exercise will be to run it via eclipse ui.
I created my own project by name GWTTest and tried to recreate the example in the Eclipse
UI. There are a few things that I have noticed. GWT Compile via Eclipse UI creates a directory by name gwttest inside the war file. Where as the directory structure created by ant is different.
In the example there is a piece of code in AskQuestionWidget getService functions as follows
String endpointURL = GWT.getModuleBaseURL() + "seam/resource/gwt";
How do I modify this code to suit my directory structure ?
We use seam+richfaces+gwt and it works very well. Although we build everything with maven, I suppose you can use ant as well. The general idea is to start the whole web application in GWT Development Mode. You don't have to compile everything (which takes a long time in case of GWT compiler). Development mode will compile requested resources on demand. By running GWT application this way, you can also debug client side code.
It is also possible to call GWT methods in response to seam actions.
Update:
I can elaborate on our solution a bit:
Maven
Your project should be configured with packaging: war. There are some official instructions on setting seam with maven (also richfaces):
http://docs.jboss.org/seam/2.2.1.CR2/reference/en-US/html/dependencies.html#d0e34791
http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/SettingsForDifferentEnvironments.html
For GWT add following sections to your pom.xml:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.1.0</version>
<scope>provided</scope> <!-- prevents from including this in war -->
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.1.0</version>
<scope>provided</scope> <!-- prevents from including this in war -->
</dependency>
<dependency>
<groupId>pl.ncdc.gwt</groupId>
<artifactId>gwt-servlet-war</artifactId>
<version>2.1.0</version>
<type>war</type> <!-- adds gwt-servlet.jar to your war, but not to your classpath -->
</dependency>
<!-- build section -->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/client/**/*.java</include>
<include>**/client/**/*.properties</include>
<include>**/shared/**/*.java</include>
<include>**/shared/**/*.properties</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/java</directory>
<includes>
<include>**/client/**/*.java</include>
<include>**/client/**/*.properties</include>
<include>**/shared/**/*.java</include>
<include>**/shared/**/*.properties</include>
<include>**/*.gwt.xml</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin> <!-- dirty hack for GWT issue #3439 - it is not really fixed -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remove-javax</id>
<phase>compile</phase>
<configuration>
<tasks>
<delete dir="${project.build.directory}/classes/javax" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.3.2.google</version>
<configuration>
<extraJvmArgs>-Xmx512M</extraJvmArgs>
<gwtVersion>${gwt.version}</gwtVersion>
<modules>
<module>com.company.gwt.project.module.Module</module>
</modules>
<soyc>false</soyc>
<draftCompile>${gwt.draft.compile}</draftCompile> <!-- you can control this with profiles -->
<localWorkers>2</localWorkers><!-- in theory should speed things up on our quad CPU hudson -->
<style>${gwt.style}</style> <!-- you can control this with profiles -->
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>gwt-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>**/*GwtTestSuite.java</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<archiveClasses>true</archiveClasses>
<warSourceDirectory>src/main/webapp-empty</warSourceDirectory> <!-- just empty dir for workaround -->
<webResources>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<exclude>app.*</exclude> <!-- name of you gwt module(s) - rename-to in gwt.xml -->
<exclude>WEB-INF/web.xml</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
This configuration should produce war with both - seam and gwt compiled. If you want to use such project in development mode put also this in pom.xml:
<dependency>
<groupId>com.xemantic.tadedon</groupId>
<artifactId>tadedon-gwt-dev</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
And add -server com.xemantic.tadedon.gwt.dev.JettyLauncher to your google web application launcher. This is maven friendly jetty launcher which might be necessary in some situations.
I hope it will help you. Are you interested in communication between gwt and richfacaes application?
If you want, take a look at <SEAM_HOME>/examples/remoting/gwt. From there, run (Make sure you have installed ANT before using it)
ant
Here goes its readme.txt file
You can view the example at:
http://localhost:8080/seam-helloworld/org.jboss.seam.example.remoting.gwt.HelloWorld/HelloWorld.html
GWT: If you want to rebuild the GWT front end, you will need to download GWT, and configure build.properties to point to it. You can then run "ant gwt-compile" from this directory. It is pre-built by default. If you want to use the GWT hosted mode, well, read all about it from the GWT docs !