Set up a Vaadin project with Maven2

Hi,
I’m new to Vaadin (and Maven); and I want to know how to set up a Vaadin Project with Maven2 (using m2eclipse plugin).

These are the steps I follow:

  1. File / New / Other / Maven Project
  2. Accept defaults in ‘New Maven Project’ window… next.
  3. In the archetype selection window I left the field ‘Catalog’ to ‘All catalogs’, and write ‘vaadin’ in the filter field. BUT after hitting return, no vaadin related archetype is showed (¿?).

Does somebody know if I have to define a special catalog or something like that?
Thanks…

How about creating a new Vaadin project and the enabling maven afterwards?

It sounds reasonable, but where are the Vaadin archetypes (‘vaadin-archetype-clean’, ‘vaadin-archetype-sample’ and ‘vaadin-archetype-widget’) mentioned in
Using Vaadin with Maven
(http://vaadin.com/wiki/-/wiki/Main/Using%20Vaadin%20with%20Maven)?

(Probably I’m seriously lost in Maven general concepts)

Sorry, but cannot really help you, as I tried out maven for the first time
today
:slight_smile: Hope someone else can answer your questions.

The archetypes are in the default Nexus repositories searched by a standard maven install. So if you have m2eclipse installed, when you create a Maven project using the “New Project…” wizard, you only have to type vaadin in the search box for the archetypes.

See http://www.screencast.com/users/jflamy/folders/Jing/media/f44608a7-a2d2-407a-967a-8acd81b6e99c for a screenshot. (the img feature of the forum seems to be broken, sorry)

Thanks…
In my home I see the vaadin archetypes (in Nexus catalog as you say), but not in my office, so I think I have a proxy issue…

Problem solved.
Declared proxy section in settings.xml

(
more detailed explanation -in spanish-
)

If one does not want to use Maven archetypes, there is a simple solution:

  1. Create a standard maven web application project.

  2. Add the following dependency:

     <dependency>
         <groupId>com.vaadin</groupId>
         <artifactId>vaadin</artifactId>
         <version>6.4.8</version>
     </dependency>
    

Et voilà !!!

P.S.: Maven concepts are a bit hard to learn - I hated Maven at the beginning, because the documentation was bad -, but now that I am over the learning curve, I really love it (and the documentation has really improved since) !!!

I highly recommend this. I use maven a great deal, but when I’m creating a new project I
only
use it when I want to make something easy to share (like an example in a blog). Every time I do this, it’s easier to go find and copy some other web project than figure it out from scratch. Adding Vaadin is the simplest part.

Cheers,
Bobby

  1. Add the maven archetype catalog http://repo1.maven.org/maven2/archetype-catalog.xml to you eclipse under Preferences->Maven->Add Remote Catalog.
  2. New Maven project
  3. Filter on Vaadin and you will see the Maven archetypes for Vaadin.