Migrating an existing Vaadin project (Maven enabled) to Google App engine

Hi have been trying to figure out how to push a vaadin project (with Maven) to the google app engine. I have tried the how to on deploying vaadin application to GAE (https://vaadin.com/wiki/-/wiki/Main/Google%20AppEngine%20HOWTO) but it only discusses creating a new project.

Also found this post on Stack Overflow (http://stackoverflow.com/questions/7131990/migrating-a-vaadin-application-to-gae) but there isn’t really an answer there either.

Could someone direct me on the steps needed to convert an existing maven project of vaadin to a google app engine?

Thank you,
Ash

I think you just have to install the Google app engine plugin to your eclipse (should be described in the Howto) and add the necessary dependencies to your pom.xml.

Here is the important part of a relatevly fresh pom.xml which i created using the appengine archetype (You could also do that too and then import all your classes):


    <properties>
        <appengine.app.version>1</appengine.app.version>
        <appengine.target.version>1.7.4</appengine.target.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <!-- Compile/runtime dependencies -->
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>${appengine.target.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-testing</artifactId>
            <version>${appengine.target.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-stubs</artifactId>
            <version>${appengine.target.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <version>2.5.1</version>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <archiveClasses>true</archiveClasses>
                    <webResources>
                        <!-- in order to interpolate version from pom into appengine-web.xml -->
                        <resource>
                            <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF</targetPath>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.google.appengine</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
                <version>${appengine.target.version}</version>
            </plugin>
        </plugins>
    </build>
</project>

Thank you Marius. I’ll try the POM. What about the appengine-web.xml ? Shouldn’t I be generating that manually or will the POM take care of that?

Not really answering the question but just noting that GAE support is broken in Vaadin 7.1.0 so if you are using 7.1, best wait for 7.1.1 first.

[quote=Ash ESM]
Thank you Marius. I’ll try the POM. What about the appengine-web.xml ? Shouldn’t I be generating that manually or will the POM take care of that?
[/quote]I’m not sure but i think when you’ve installed the google app engine plugin for eclipse you should be able to convert your project to a GAE project which should add the xml (Also have a look at the HowTo again because you may also have to do other,manual stuff which doesn’t automatically happen using the plugin e.g. change the servlet in your web.xml). Before you start testing it out you should make a backup of your project though.
I think the most reliable way to do it would be to create a new maven appengine project using the archetype and then copy your classes, resources, … in it.
Oh and also mind what Henri said. So if you’re then done converting the project and testing it you might get exceptions coming from the GAEVaadinServlet, VaadinSession, … which will mostly be fixed in 7.1.1.