Creating a Maven project in Eclipse

In order to create a Vaadin project which uses Maven in Eclipse, i followed
those instructions
to the book. (By the way, the vaadin-archetype-application was not in the list of archetypes, so if I didn’t do anything wrong, this information should be added to the article)

Running the application with jetty works fine but compiling the widgetsets just results in this error message:

[i]
No plugin found for prefix ‘vaadin’ in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
available from the repositories [local (/Users/xxx/.m2/repository), central (http://repo.maven.apache.org/maven2)]
→ [Help 1]

[/i]

Any ideas what went wrong here?

If vaadin-archetype-application is not on the list, most likely your m2e cache of the archetypes etc. available in Maven Central is not up to date. Sometimes m2e does not build or update it correctly. Rebuilding the indexes in the Maven Repositories view might help.

As for the latter issue, the plug-in is also in Maven Central so I suspect the issue behind that is the same - a stale or corrupted local m2e index - if your POM is correctly created from a recent version of the application archetype.

Herni

Thank you for your quick reply, that did the trick. Now, I ran into the same problem as
this guy
. I am totally new to Maven so could you elaborate on you answer in that threat a bit more. What at exactly am I supposed to change?

Thank you in advance!

Hi, I’m that guy. Just add:


                            <goal>update-theme</goal>
                            <goal>compile-theme</goal>

At around row 190 where the resources, compile and update-widgetset goals already are.

Hey Jocke

that worked, thanks. Now, one last question, just out of curiosity: When I create a Vaadin Project in Eclipse (not using Maven) I make Eclipse make it to run on my local Tomcat so that I can access it under “http://localhost:8080/MyProject”. That doesn’t seem to work with the Maven project I created though. So why doesn’t it and how could I fix that?

I appreciate the help :slight_smile:

You might need to use the m2e-WTP plug-in in Eclipse to use Eclipse WTP features such as the integrated server adapters. For that, you might need to add the “Dynamic Web Project” nature.

The other alternative is to run the project using Maven (e.g. “mvn jetty:run” or “mvn tomcat:run” if those are correctly configured for the project). For Maven projects, I usually prefer this approach as it keeps the whole workflow in Maven and avoids some of the tricks used to integrate Maven with other systems.