How to create vaadin maven project

Hello Friends,
I am a vaadin developer still now using ordinary vaadin project then i am going to next level of project life cycle management for maven integration for my application i am unable to try to change the maven project but it’s not run. i already using maven project ordinary java project and web project So please if anybody there let me know basic steps for detail …

Thanks
karthik.elavan

first hit on google with ‘vaadin maven’


Vaadin with Maven

Hi ,
did you give the information i have to followed but i can not able to create maven project for vaadin framework,

This way i try to maven project:

karthik@nbcpu02:~/VAADIN/vaadinmaven$ mvn archetype:generate -DarchtypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetypen -DarchetypeVersion=LATEST -DgroupId=com.test -DartifactId=apptrack -Dversion=1.0 -Dpackaging=war
[INFO]
Scanning for projects…
[INFO]
Searching repository for plugin with prefix: ‘archetype’.
[INFO]

[INFO]
Building Maven Default Project
[INFO]
task-segment: [archetype:generate]
(aggregator-style)
[INFO]

[INFO]
Preparing archetype:generate
[INFO]
No goals needed for project - skipping
[INFO]
[archetype:generate {execution: default-cli}]

[INFO]
Generating project in Interactive mode
[INFO]
artifact org.apache.maven.archetypes:vaadin-archetypen: checking for updates from central
[INFO]

[ERROR]
BUILD FAILURE
[INFO]

[INFO]
The desired archetype does not exist (org.apache.maven.archetypes:vaadin-archetypen:LATEST)
[INFO]

[INFO]
For more information, run Maven with the -e switch
[INFO]

[INFO]
Total time: 3 seconds
[INFO]
Finished at: Mon Mar 05 10:19:31 IST 2012
[INFO]
Final Memory: 14M/128M

And another ways i try to maven project: i got error

karthik@nbcpu02:~/VAADIN/vaadinmaven$ mvn archetype:generate -DarchtypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetypen -DarchetypeVersion=6.7.3 -DgroupId=com.test -DartifactId=apptrack -Dversion=1.0 -Dpackaging=war
[INFO]
Scanning for projects…
[INFO]
Searching repository for plugin with prefix: ‘archetype’.
[INFO]

[INFO]
Building Maven Default Project
[INFO]
task-segment: [archetype:generate]
(aggregator-style)
[INFO]

[INFO]
Preparing archetype:generate
[INFO]
No goals needed for project - skipping
[INFO]
[archetype:generate {execution: default-cli}]

[INFO]
Generating project in Interactive mode
Downloading: http://repo1.maven.org/maven2/org/apache/maven/archetypes/vaadin-archetypen/6.7.3/vaadin-archetypen-6.7.3.jar
[INFO]
Unable to find resource ‘org.apache.maven.archetypes:vaadin-archetypen:jar:6.7.3’ in repository central (http://repo1.maven.org/maven2)
[INFO]

[ERROR]
BUILD FAILURE
[INFO]

[INFO]
The desired archetype does not exist (org.apache.maven.archetypes:vaadin-archetypen:6.7.3)
[INFO]

[INFO]
For more information, run Maven with the -e switch
[INFO]

[INFO]
Total time: 5 seconds
[INFO]
Finished at: Mon Mar 05 10:20:33 IST 2012
[INFO]
Final Memory: 14M/128M
[INFO]

novabit@nbcpu02:~/VAADIN/vaadinmaven$ mvn -e switch

  • Error stacktraces are turned on.
    [INFO]
    Scanning for projects…
    [INFO]

[ERROR]
BUILD FAILURE
[INFO]

[INFO]
Invalid task ‘switch’: you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO]

[INFO]
Trace
org.apache.maven.BuildFailureException: Invalid task ‘switch’: you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1830)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]

[INFO]
Total time: < 1 second
[INFO]
Finished at: Mon Mar 05 10:21:04 IST 2012
[INFO]
Final Memory: 1M/56M
[INFO]

if you have any good example please…
Please help me…

You have “-DarchetypeArtifactId=vaadin-archetypen”, shouldn’t it be “-DarchetypeArtifactId=vaadin-archetype-clean” ?

Hi Mathias Clerc,
Did you give the information very useful but one thinks have in doubt, i have create maven sample is fine but which one archetype i choosed b’cos when i was create maven project.

karthik@nbcpu02:~/VAADIN$ cd vaadinmaven/
karthik@nbcpu02:~/VAADIN/vaadinmaven$ mvn archetype:generate
karthik@nbcpu02:~/VAADIN/vaadinmaven$ -DarchetypeGroupId=com.vaadin \

-DarchetypeVerison=LATEST
-DgroupId=test.application
-DartifactId=test
-Dversion=1.0
-Dpackaging=war
[INFO]
Scanning for projects…
[INFO]
Searching repository for plugin with prefix: ‘archetype’.
[INFO]


[INFO]
Building Maven Default Project
[INFO]
task-segment: [archetype:generate]
(aggregator-style)
[INFO]

[INFO]
Preparing archetype:generate
[INFO]
No goals needed for project - skipping
[INFO]
[archetype:generate {execution: default-cli}]

[INFO]
Generating project in Interactive mode
[INFO]
No archetype defined. Using maven-archetype-quickstart (com.vaadin:maven-archetype-quickstart:1.0)
Choose archetype:

1: remote → docbkx-quickstart-archetype (-)
2: remote → archetype-webx-quickstart (-)
3: remote → multi (-)
4: remote → simple (-)
5: remote → basic-gwt-webapp (webapp archetype using protostuff, json and gwt)
6: remote → basic-webapp (webapp archetype using protostuff, json and jquery)
7: remote → simple-gwt-webapp (webapp archetype using protobuf, json and gwt)
8: remote → simple-webapp (webapp archetype using protobuf, json and jquery)
9: remote → springmvc-archetype (-)
10: remote → maven-archetype-executable (Executable Quickstart Archetype that is ready to run with ‘java -jar’)
11: remote → maven-archetype-scala-executable (Creates executable Scala Project that is ready to run with ‘java -jar’)
12: remote → plsql-package-archetype (a sample archetype that creates a project with a PL/SQL package inside and extends the parent project)
13: remote → plsql-project-archetype (preconfigured PL/SQL project)
14: remote → plsql-webapp-archetype (preconfigured PL/SQL webapp)
15: remote → parent-archetype (-)
16: remote → apparat-archetype-asm (-)
17: remote → apparat-archetype-tdsi (-)
18: remote → gquery-archetype (This archetype generates a Gwt-2.4.0 project with all set to use GwtQuery and its plugins.)
19: remote → gquery-plugin-archetype (-)
20: remote → jannocessor-sample-archetype (Multi-module sample project for annotation-driven source code generation with JAnnocessor)
21: remote → jdbc-proc-archetype (Creates simple project with jdbc-proc support)
22: remote → playn-archetype (Archetype for PlayN game projects.)
23: remote → liferay-ext-archetype (Provides an archetype to create Liferay extensions.)
24: remote → liferay-hook-archetype (Provides an archetype to create Liferay hooks.)
25: remote → liferay-layouttpl-archetype (Provides an archetype to create Liferay layout templates.)
26: remote → liferay-portlet-archetype (Provides an archetype to create Liferay portlets.)
27: remote → liferay-servicebuilder-archetype (Provides an archetype to create Liferay Service Builder portlets.)
28: remote → liferay-theme-archetype (Provides an archetype to create Liferay themes.)
29: remote → liferay-web-archetype (Provides an archetype to create Liferay webs.)
30: remote → extjs-springmvc-webapp (A maven Archetype to create new EXTJS project powered by a spring MVC service.)
31: remote → rdfbean-tapestry-quickstart (-)
32: remote → rdfbean-tapestry-quickstart (-)
33: remote → sample-server-archetype (Sample server archetype)
34: remote → skeleton-server-archetype (Skeleton server archetype)
35: remote → j2me-simple (Maven 2 Archetype for midlet application using j2me-maven-plugin)
36: remote → slipstream-module (-)
37: remote → i_jsf_XXXX-archetype (-)
38: remote → i_jsf_xxxx_htmlunit-archetype (-)
39: remote → jersey-quickstart-ejb (An archetype which contains a simple Jersey based EJB project.)
40: remote → jersey-quickstart-grizzly (An archetype which contains a quickstart Jersey project based on Grizzly container.)
41: remote → jersey-quickstart-grizzly2 (An archetype which contains a quickstart Jersey project based on Grizzly2 container.)
42: remote → jersey-quickstart-webapp (An archetype which contains a sample Jersey based Webapp project.)
43: remote → itest-sample-s30-archetype (-)
44: remote → vaadin-archetype-addon (-)
45: remote → vaadin-archetype-clean (This archetype generates a simple Vaadin application as a Maven project.
No custom widgetset is included.)
46: remote → vaadin-archetype-jpacontainer (This archetype generates a simple Vaadin application using JPAContainer as a Maven project.)
47: remote → vaadin-archetype-portlet (This archetype creates a simple porlet with required Vaadin dependencies. In addition to standard JSR 286 configurations the archetype also adds liferay specific configuration files, but they shoudn’t affect other portals.)
48: remote → vaadin-archetype-sample (This archetype generates a Vaadin application as a Maven project.
The application contains a custom GWT widgetset that is compiled
by the GWT compiler and integrated into the project as part of the
build process. The application is based on the Vaadin Color Picker
Demo application available at http://vaadin.com.)
49: remote → vaadin-archetype-touchkit (This archetype generates a simple Vaadin application using TouchKit as a Maven project.)
50: remote → vaadin-archetype-widget (This archetype generates a Vaadin widget project for Vaadin 6.2+ and a test application.)
.
.
.
.
.
500 …

lot of type more than 500 types haveing maven console which one i choose… please help me

Choose a number: : 1
Choose version:
1: 2.0.10
2: 2.0.11
3: 2.0.12
4: 2.0.13
5: 2.0.14
Choose a number: 5: 5
Downloading: http://repo1.maven.org/maven2/com/agilejava/docbkx/docbkx-quickstart-archetype/2.0.14/docbkx-quickstart-archetype-2.0.14.jar

Downloading: http://repo1.maven.org/maven2/com/agilejava/docbkx/docbkx-quickstart-archetype/2.0.14/docbkx-quickstart-archetype-2.0.14.pom

[INFO]
Using property: groupId = test.application
[INFO]
Using property: artifactId = test
[INFO]
Using property: version = 1.0
[INFO]
Using property: package = test.application
Confirm properties configuration:
groupId: test.application
artifactId: test
version: 1.0
package: test.application
Y: y
[INFO]

[INFO]
BUILD SUCCESSFUL
[INFO]

[INFO]
Total time: 1 minute 33 seconds
[INFO]
Finished at: Mon Mar 05 14:59:58 IST 2012
[INFO]
Final Memory: 13M/128M
[INFO]

please help me which one i choose in vaadin development

I see
-DarchetypeVerison

“Verison” is probably a typo.

45: remote -> vaadin-archetype-clean (This archetype generates a simple Vaadin application as a Maven project.
No custom widgetset is included.)

Isn’t that the one you are looking for ?

Hi All,

i would like to start the application using with vaadin and spring with hibernate and that should be in layered wise means one project is for web and one project is for service and one project is for DAO(hibernate) can anybody guide me what is the good approach to start, any archetype is already there for this if yes kindly share me the link,that would be helpful for me to start my design.