Vaadin One Minute Tip: Getting started with Vaadin

Hi! I wanted to show how easily you can create a Vaadin application and run it, so I did a screen capture of me doing it, which takes less than one minute. Without further ado, here’s the video.


Vaadin One Minute Tip, Part 1: Create a Vaadin project and run it.

All you need preinstalled in Java and Maven to be able follow it. It uses the maven command line archetype tool to create the project, and it is run through maven with the support of Jetty.

Steps:


  1. $ mvn archetype:generate
    ’ to start process of creating a new project

  2. vaadin
    ’ to search for Vaadin related archetypes
  3. Select ’
    vaadin-archetype-application
    ’ from the list by typing in the corresponding number. The number might change as they are ordered alphabetically, but as long as I can remember, the number has been ‘5’.
  4. You are presented with a list of Vaadin versions, just press enter to select the latest one.
  5. Type in a preferred package and project name. For other fields I just press enter to get the defaults.
  6. confirm that everything is okay by typing ’
    y
    '.

  7. $ cd hello-vaadin
    ’ to go into project folder

  8. $ mvn jetty:run
    ’ to start an embedded Jetty instance.
  9. Point your browser at http://localhost:8080 to see and use your application

That’s it!

I have two additional videos lined up, which will show you how to import these to and IDE, modify them and run them within the IDE, Eclipse and IntelliJ IDEA respectively.

Part 2 is now live. Take the Vaadin project you created in part 1, or any other maven based project, and bring it over to Eclipse. Import it, change some code and start Jetty, all from within Eclipse.


Vaadin One Minute Tip, Part 2: Import, edit and run your Vaadin project in Eclipse.

Steps:

  1. Right click the Project Explorer panel
  2. Import → Import from menu
  3. Maven → Existing Maven Project
  4. Point at the root folder of your Maven project
  5. Finish the wizard
  6. Open up the MyUI java file
  7. Make an edit to the application
  8. Right click project in project explorer
  9. Run As → Maven build…
  10. In the goal field, type ‘jetty:run’
  11. Click Run
  12. Go to http://localhost:8080 with your browser and notice that your change to the application is live

Next video will do the same thing but with IntelliJ IDEA.

Part 3 is the same as Part 2, but instead of Eclipse, we use IntelliJ IDEA. Take the Vaadin project you created in part 1, or any other maven based project, and bring it over to IntelliJ IDEA. Import it, change some code and start Jetty from within IDEA.


Vaadin One Minute Tip, Part 3: Import, edit and run your Vaadin project in IntelliJ IDEA.

Steps:

  1. Import Project
  2. Point at the root folder of your Maven project
  3. Import project from external model → Maven
  4. Blast through the rest of the wizard as fast as you can and press fininsh.
  5. Open up the MyUI java file
  6. Make an edit to the application
  7. Click on Maven Projects menu at the right
  8. Double-click on hello-vaadin → Plugins → jetty → jetty:run
  9. In the goal field, type ‘jetty:run’
  10. Go to http://localhost:8080 with your browser and notice that your change to the application is live

If you have some added ideas for this video series, or any other feedback, I would love to hear them!

Very nice!