Here is how to generate the project itself (source):
mvn archetype:generate \
-DarchetypeGroupId=org.codehaus.mojo \
-DarchetypeArtifactId=gwt-maven-plugin \
-DarchetypeVersion=1.1 \
-DgroupId=myGroupId \
-DartifactId=myArtifactId
e.g.
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo \
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=1.1 \
-DgroupId=com.google.gwt.demo -DartifactId=gwt-demo
There are only few thing needed to be done:
change gwt version from 1.6.4 to 2.0.0-rc1
remove dependency for gwt-servlet
add plugin repository:
<pluginRepositories>
<pluginRepository>
<id>codehaus-snapshots-repository</id>
<name>codehaus snapshots repository</name>
<url>http://snapshots.repository.codehaus.org</url>
</pluginRepository>
</pluginRepositories>
and add configuration tag to gwt-maven-plugin
<configuration>
<disableCastChecking>true</disableCastChecking>
<disableClassMetadata>true</disableClassMetadata>
<runTarget>/com.google.gwt.demo.Application/Application.html</runTarget>
<extraJvmArgs>-Xmx1024m -Xss4024k</extraJvmArgs>
</configuration>
After this changes, mvn gwt:run should start the gwt development mode window.

Now, gwt development mode window should appear. By clicking last line in log window, details should appear with link Launch default browser. Just click it. If you have not yet installed GWT plugin for your browser, browser will ask you to, because development Mode requires that you install the GWT Developer Plugin in your browser.

Here is the whole pom.xml after updates:
<?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">
<!--
GWT-Maven archetype generated POM
-->
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gwt.demo</groupId>
<artifactId>gwt-demo</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>gwt-maven-archetype-project</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- convenience to define GWT version in one place -->
<gwt.version>2.0.0-rc1</gwt.version>
<!-- tell the compiler we can use 1.5 -->
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
</properties>
<dependencies>
<!-- GWT dependencies (from central repo) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<configuration>
<disableCastChecking>true</disableCastChecking>
<disableClassMetadata>true</disableClassMetadata>
<runTarget>/com.google.gwt.demo.Application/Application.html</runTarget>
<extraJvmArgs>-Xmx1024m</extraJvmArgs>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>codehaus-snapshots-repository</id>
<name>codehaus snapshots repository</name>
<url>http://snapshots.repository.codehaus.org</url>
</pluginRepository>
</pluginRepositories>
</project>
That's it, for now, only helloworld, but it is enough to get you going.
Tuesday, December 1, 2009
Alias like command for DOS
Unix has one great command that can ease a lot use of shell, especially when you need to use same commands over and over again. That would be alias command. I was wondering is there a similar command for DOS, and I thought, there must be one, just need to find it. And I did, command is called doskey and here is the small guide how to use it. doskey commands are normally only visible to the current CMD session. That's why it would be good idea to make a .bat file containing doskey commands, and put is somewhere on system path (e.g. c:\windows) and call it ali.bat. Then it would be possible to use doskey commands after typing ali in command line. Here's the content of ali.bat file:
Of course file containing doskey commands does not have to be called ali.bat, but is should be something short and catchy, because you'll need to call this file each time when you open a new CMD window if you want to use commands that are declared inside.
@echo off
doskey mee=mvn eclipse:eclipse
doskey meeds=mvn eclipse:eclipse -DdownloadSources=true
doskey mec=mvn eclipse:clean
doskey mci=mvn clean install
doskey ls=dir
doskey ab=ant build
echo DONE!
Of course file containing doskey commands does not have to be called ali.bat, but is should be something short and catchy, because you'll need to call this file each time when you open a new CMD window if you want to use commands that are declared inside.
Subscribe to:
Posts (Atom)
