My Vaadin Experience

Hi everybody,

I am an GWT veteran (2008) and I wanted to check out Vaadin. It can replace the Eclipse RAP in my toolchain since I am very upset with the Eclipse RAP. Its not that RAP is bad, its very good indeed but the Eclipse Way is totally annoying. WTP is a pain to use for me. Always you fiddle with something that should be easy and wont work.

The GWT experience is better. Install, run, use - fine. I can show my clients GWT and they like what they see. The client want’s two things: Job is done, and can expect that the inhouse junior developer is capable to extend and understand the solution.

And what does Vaadin do? Same as RAP. Setup fighting continues. And if you install and try to run it? It will not work out of the box.

I am not stupid. I am a ten years worth Java veteran. I know what I want and I know what I have to do. But I am also not very happy. I throw almost two days at this. I tried it the WTP way (pain as ever) then I switched back to RunJettyRun, which is what I want and need (its instantly, its inside my vm and I understand what it does).

So can someone please help me get the Maven 2 sample project up and working without any errors? And if yes, can someone please correct / update introduce a new version of the achetype? I need to be able to show a client a fresh framework, install vaadin and run a sample application without errors and without fighting configuration. It has to look and be easy or it will not be accepted.

I am used to fight with Eclipse, the inclorious WTP and all those different configuration issues making things difficult that should be easy. Its the same for 5 or 8 years now. Things wont change I guess, but Vaadin should not contribute it. I sold many clients to Google’s GWT since it is so easy to setup (download, install, done) and for Vaadin should be the same.

So please help to solve this once and for all. If you know how the corrected pom.xml should look like for the sample application, please post it / or send me a copy. And if some of the coredeveloper can please update the archetype, I would be even more happy.

Cheers,

Martin (Kersten),
Germany

I also chose Vaadin as a candidate framework for next application. Currently I’m working on simple “proof of concept” application which should show us if we can implement required features using vaadin. I’ve tried to setup vaadin project using maven archetype, but had problems with the setup. Therefore I’m currently working without maven. When we speak about the framework I’m really satisfied with it, it’s easy to understand and to implement things. But I would also be thankful if somebody can show how to easily use vaadin with maven for development and for continuous integration…

But if you just want to show the capabilities of Vaadin to your client, the best showcase is sampler:
http://demo.vaadin.com/sampler

Good luck with your effort!

Well I end up adding a jar and fuzzing around with a simple to set up project - just as you did. But serious two days… Do you also use the runjettyrun plugin? I tried to set up this too (http://ssw.jku.at/dcevm/binaries/). But I faild in ubuntu/xfce. It is nice to have such a modified jvm.

Vaadin will replace Eclipse RAP for me since I am a GWT veteran it would be better.

I’m a bit astonished that you’ve had such a hard time setting up a Vaadin project with Maven. My experience with Vaadin is that it just works out of the box without the need to put too much effort into configuration stuff. It’s one of the big advantages of Vaadin. But then again, sometimes things just seem to work against you and you get stuck on silly things. Using the Vaadin Maven archetypes used to work quite well for me. I don’t have a link at hand to a tutorial on this. But I do have a working Hello World Maven setup that you can use and build upon. This setup is quite simple and does not include any configuration for Vaadin’s widget set compilation. But you can easily enhance that example once it is working for you. You find that setup on
GitHub
. There are two projects you can use, one is with a single-module setup, the other uses a multi-module setup. The single-module setup goes with a
tutorial
, while the tutorial for the second project will be published in the next few days. I hope these are useful for you to get started without too much more frustration.

I will clone it and give it a try. I will report back.

The problems where caused by new Maven Project → Archetype (?)vaadin-sample. When run it says that the POM.xml is flawed since the lifecycle of two plugins is not managed (new to maven 2 i guess) and so this needs a fix. You wont find one in the net and the only advise is to hit quick fix and set it to ignore (didn’t work for me). And using the original new Vaadin project also was broken. This was a clean install. Thats why I was puzzled.

Ok, I see what the problem is. The errors you’re getting (I see them, too) shouldn’t be that serious. It’s just m2eclipse complaining that it doesn’t know the incriminated plugins executions and that it doesn’t know how to integrate these into the Eclipse project configuration (see
http://wiki.eclipse.org/M2E_plugin_execution_not_covered
on that problem. Using the quick fix to ignore that should be enough (this works for me at least). In any event, this problem will not jeopardize the stability of your build as this is just an m2eclipse related problem. In addition, this plugin configuration is only needed if you intend to compile your widgetset. This is only necessary if you’re developing new Vaadin widgets or if you’re integrating Vaadin addons. In that case, the standard configuration from the vaadin-sample archetype should work as is.

Is there anything I can easily do / change to get rit of the errors? I need the Maven Project working in all of its glory. Also I will later on surely write a GWT Widget for the sake of discovery.

I now created a vaadin-clear archetype project and it does not have the gwt support it seams. There are no errors. But i noticed that it does not create src/test/java folder correctly (can someone verify this?). I have to create this manually. Someone capable should solve all those issues. I guess everyone trying to start a new Maven project will experience the same “huh?” like I did.

So please this is curcial. I dont wanna know how many start using this and all thats left is: “too broken”.

I got it to run. Finaly I got it working. This should have been so much easier. I am quite disappointed. The last problem was a jetty related problem so now I can see the sample application and I am free to build what I want to build.

It sounds like your problems are with Eclipse, not Vaadin. A Vaadin app is just like any other Java EE app with a dependency on some library. I’ve got plenty of examples of Vaadin apps I can share with you, but a simple pom.xml like this is all you need. Just build the app and deploy the war file to whatever app server you’d like.

<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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>YOUR_GROUP</groupId>
    <artifactId>YOUR_ARTIFACT</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>
    <name>SOME NAME HERE</name>
    <repositories>
        <repository>
            <id>java.net2</id>
            <name>Repository hosting the jee6 artifacts</name>
            <url>http://download.java.net/maven/2</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
            <version>6.8.2</version>
            <type>jar</type>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <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.1-beta-1</version>
                <configuration>
                    <!-- this is here in case you're using serv 3.0 and don't have web.xml -->
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>
        <finalName>YOUR_WAR_FILE_NAME</finalName>
    </build>
    <profiles>
        <profile>
            <id>endorsed</id>
            <activation>
                <property>
                    <name>sun.boot.class.path</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>2.0.2</version>
                        <configuration>
                            <!-- javaee6 contains upgrades of APIs contained within the JDK itself.
                                 As such these need to be placed on the bootclasspath, rather than classpath of the
                                 compiler.
                                 If you don't make use of these new updated API, you can delete the profile.
                                 On non-SUN jdk, you will need to create a similar profile for your jdk, with the similar property as sun.boot.class.path in Sun's JDK.-->
                            <compilerArguments>
                                <bootclasspath>${settings.localRepository}/javax/javaee-endorsed-api/6.0/javaee-endorsed-api-6.0.jar${path.separator}${sun.boot.class.path}</bootclasspath>
                            </compilerArguments>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>javax</groupId>
                                <artifactId>javaee-endorsed-api</artifactId>
                                <version>6.0</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>