gwt 2.3 + spring 2 + maven 2

79 views
Skip to first unread message

Mike Chai

unread,
Aug 17, 2011, 6:32:59 PM8/17/11
to Google Web Toolkit
I'm new developing web applications with Java, so maybe this is
implicitly known in the community but upon trying to search for
integration for these 3 technologies I couldn't find a very
straightforward answer. Some information is dated back to 2008ish
where some people created "glue" to integrate gwt and spring, but I
found some news on spring saying something about google integration
into spring.

Some of the tools also seem to be depreciated and redirect the user to
codehaus' maven plugin, but on first look I can't find a download on
it and it just links to google's eclipse plugin.

tl; dr: what's the current standard for integrating these 3
technologies?

Y2i

unread,
Aug 17, 2011, 7:06:55 PM8/17/11
to google-we...@googlegroups.com
There is some documentation on GWT site on GWT, SpringSource and Roo integration

Daniel Guggi

unread,
Aug 17, 2011, 7:22:48 PM8/17/11
to google-we...@googlegroups.com
@spring you may have a look here (requestfactory + spring3 integration):
http://jsinghfoss.wordpress.com/2011/08/10/gwt-2-2-0-requestfactory-spring-3-0-x-integration/

here an example pom (i use maven 3)

<?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>gwtapp</groupId>
    <artifactId>GwtApp</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>gwtapp.GwtApp</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.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwtVersion}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt.inject</groupId>
            <artifactId>gin</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <!-- Generate compiled stuff in the folder used for developing mode -->
        <outputDirectory>target/www/WEB-INF/classes</outputDirectory>

        <plugins>

            <!-- GWT Maven Plugin -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>2.2.0</version>
                <dependencies>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-user</artifactId>
                        <version>${gwtVersion}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-dev</artifactId>
                        <version>${gwtVersion}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-servlet</artifactId>
                        <version>${gwtVersion}</version>
                    </dependency>
                </dependencies>
                <!-- JS is only needed in the package phase, this speeds up testing -->
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <!-- Plugin configuration. There are many available options, see gwt-maven-plugin
                    documentation at codehaus.org -->
                <configuration>
                    <!-- URL that should be automatically opened in the GWT shell (gwt:run). -->
                    <runTarget>GwtApp.html</runTarget>
                    <!-- Location of the develop-mode web application structure (gwt:run). -->
                    <hostedWebapp>target/www</hostedWebapp>
                    <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
                    <compileReport>true</compileReport>
                </configuration>
            </plugin>

            <!-- Add source folders to test classpath in order to run gwt-tests as
                normal junit-tests -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <additionalClasspathElements>
                        <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
                        <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
                    </additionalClasspathElements>
                    <useManifestOnlyJar>false</useManifestOnlyJar>
                    <forkMode>always</forkMode>

                    <!-- Folder for generated testing stuff -->
                    <systemProperties>
                        <property>
                            <name>gwt.args</name>
                            <value>-out target/www</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>

            <!-- Copy static web files before executing gwt:run -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.2</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/www</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/webapp</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Delete gwt generated stuff -->
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/webapp/gwtapp</directory>
                        </fileset>
                        <fileset>
                            <directory>src/main/webapp/WEB-INF/classes</directory>
                        </fileset>
                        <fileset>
                            <directory>tomcat</directory>
                        </fileset>
                        <fileset>
                            <directory>www-test</directory>
                        </fileset>
                        <fileset>
                            <directory>.gwt-tmp</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.7</version>  <!-- Note 2.8 does not work with AspectJ aspect path -->
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>false</downloadJavadocs>
                    <wtpversion>2.0</wtpversion>
                    <additionalBuildcommands>
                        <buildCommand>
                            <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
                        </buildCommand>
                    </additionalBuildcommands>
                    <additionalProjectnatures>
                        <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
                    </additionalProjectnatures>
                </configuration>
            </plugin>

        </plugins>
    </build>
</project>



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Juan Pablo Gardella

unread,
Aug 18, 2011, 7:37:33 AM8/18/11
to google-we...@googlegroups.com

Giuseppe La Scaleia

unread,
Aug 18, 2011, 9:17:04 AM8/18/11
to google-we...@googlegroups.com
With mvn jetty:run doesn't work. In hosted mode is very slow.
Regards Giuseppe

2011/8/18 Juan Pablo Gardella <gardella...@gmail.com>



--
Giuseppe La Scaleia
CNR - IMAA
geoSDI
Sviluppo Software

C.da S. Loja
85050  Tito Scalo - POTENZA (PZ)
Italia

phone:  +39 0971427305
fax:      +39 0971 427271
mob:    +39 3804697436
mail:     giuseppe....@geosdi.org
skype:  glascaleia

web:     http://www.geosdi.org


 

Juan Pablo Gardella

unread,
Aug 18, 2011, 9:26:32 AM8/18/11
to google-we...@googlegroups.com
Nop. It's works in dev mode inside eclipse. I don't use mvn jetty:run so don't make run in this manner. Yes is slow in dev mode. If you use Windows with IE is the fastest browser in dev mode.

Juan

2011/8/18 Giuseppe La Scaleia <giuseppe....@geosdi.org>

Juan Pablo Gardella

unread,
Aug 18, 2011, 9:26:53 AM8/18/11
to google-we...@googlegroups.com
Nop. It's works in dev mode inside eclipse. I don't use mvn jetty:run so don't make run in this manner. Yes is slow in dev mode. If you use Windows with IE is the fastest browser in dev mode.

Juan

2011/8/18 Giuseppe La Scaleia <giuseppe....@geosdi.org>
With mvn jetty:run doesn't work. In hosted mode is very slow.

Giuseppe La Scaleia

unread,
Aug 18, 2011, 9:31:19 AM8/18/11
to gardella...@gmail.com, google-we...@googlegroups.com
I don't use Windows i use only Ubuntu or Mac.
So you say to deploy the war under tomcat??

Mike Chai

unread,
Sep 2, 2011, 7:10:50 PM9/2/11
to Google Web Toolkit
Thanks for the responses. To clarify, I want to use GWT to build an
interface for an existing Java backend that is using Spring.
Integration using the STS isn't needed but I'll probably do it
anyways. Is there a way to do this without using hackish methods?

On Aug 18, 6:31 am, Giuseppe La Scaleia
<giuseppe.lascal...@geosdi.org> wrote:
> I don't use Windows i use only Ubuntu or Mac.
> So you say to deploy the war under tomcat??
> Regards Giuseppe
>
> 2011/8/18 Juan Pablo Gardella <gardellajuanpa...@gmail.com>
>
>
>
>
>
>
>
> > Nop. It's works in dev mode inside eclipse. I don't use mvn jetty:run so
> > don't make run in this manner. Yes is slow in dev mode. If you use Windows
> > with IE is the fastest browser in dev mode.
>
> > Juan
>
> > 2011/8/18 Giuseppe La Scaleia <giuseppe.lascal...@geosdi.org>
>
> >> With mvn jetty:run doesn't work. In hosted mode is very slow.
> >> Regards Giuseppe
>
> >> 2011/8/18 Juan Pablo Gardella <gardellajuanpa...@gmail.com>
>
> >>> Seehttps://bitbucket.org/gardellajuanpablo/gwt-sample/wiki/Home.
>
> >>> 2011/8/17 Daniel Guggi <daniel.gu...@gmail.com>
>
> >>>> @spring you may have a look here (requestfactory + spring3 integration):
>
> >>>>http://jsinghfoss.wordpress.com/2011/08/10/gwt-2-2-0-requestfactory-s...
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages