Vaadin 12 : Is it has Maven archetype?

50 views Asked by At

In official documentation of Vaadin 8 I found how use Maven archetype:

https://vaadin.com/docs/v8/framework/getting-started/getting-started-archetypes.html

Ok. Something like this:

mvn -B archetype:generate \
        -DarchetypeGroupId=com.vaadin \
        -DarchetypeArtifactId=vaadin-archetype-application \
        -DarchetypeVersion=8.3.3 \
        -DgroupId=org.test \
        -DartifactId=vaadin-app \
        -Dversion=1.0-SNAPSHOT

Nice.

But what about Vaadin 12? Is it has Maven archetype ?

2

There are 2 answers

0
codinghaus On

No, there are no maven archetypes for Vaadin 10+ (yet).

You may however try these as long as there are no "official" archetypes.

https://github.com/viritin/vaadin-flow-archetypes

For example:

mvn archetype:generate  \
    -DarchetypeGroupId=in.virit  \
    -DarchetypeArtifactId=viritin-vaadin-flow-archetype  \
    -DarchetypeVersion=1.0
    -DgroupId=org.test \
    -DartifactId=vaadin-app \
    -Dversion=1.0-SNAPSHOT

But as of now I think the officially prefered way to create Vaadin 10+ projects is using a starter project from

https://vaadin.com/start/lts

where you can download a zip file containing a maven project setup.

0
Basil Bourque On

Update: artifacts vaadin-core & vaadin

Maven artifacts are now available for Vaadin Flow, versions 10, 11, 12, 13, & 14.

If you want to restrict yourself to using only the free-of-cost non-commercial widgets from Vaadin Ltd, use artifact vaadin-core.

If you might want access to the commercial widgets as well as the free-of-cost widgets, use the artifact vaadin.

You can grab the command-line text for creating an empty project via Maven by copying from the Maven tab of the Get started with Vaadin page. Currently:

mvn -B archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=LATEST -DgroupId=org.test -DartifactId=vaadin-app -Dversion=1.0-SNAPSHOT

And the Download tab on that page will create and download an entire Maven-driven project in any of 3 flavors:

  • Spring Boot
  • CDI & Java EE
  • Plain Java Servlet

If you do not know about Spring or CDI, then use the third option, Plain Java Servlet. Expand the downloaded .zip file. Import the folder as a Maven project into your IDE such as IntelliJ, NetBeans, or Eclipse. You can immediately run your new web app via Jetty web container bundled via Maven.