java - How do I start a new vaadin project in IntelliJ IDEA? -
the answer based on maven archetype approach works. update , accept answer based on using built in wizard if intellij wizard/template vaadin ever fixed.*
i managed create new project using maven archetype terminal window, , import intellij idea, configured gwt facet, when run says:
"error running unnamed: no gwt modules found in 'projectname'"
i confess being total beginner @ java, intellij, , vaadin, not mention gwt.
i tried creating new vaadin projet using native vaadin plugin comes intellij idea (ultimate). using ultimate, it's trial.
update:: not see vaadin projects in new project window's list of available project templates. that's because confused two-levels-of-new-projects idea in intellij's new project wizard. sorted out now.
update2:: can follow steps either of 2 answers below , project builds doesn't run. assume right add gwt run-target, because before run menu entirely grayed out. believe grayed out because there no modules listed in modules list gwt facet.
i assume must create new run/debug configuration must 1 of following, , gwt made sense since vaadin based atop gwt:
after add gwt still same error got when started maven archetype: no gwt modules. , have no idea people talking picking drop down module...
update3 still unable either solution below work. stuck @ screen , unable show modules in "gwt modules load" combo box remains grayed out. believe drop down module supposed pick, nothing below tells me how un-grayed-out (enabled):
i managed (a) add gwt facet manually, (b) configure it, , (c) run. leads runtime error (the app not open in web browser, clear it's close working.)
here's how did this.
first create vaadin project using maven artefact.
c:\dev> mvn archetype:generate -darchetypegroupid=com.vaadin -darchetypeartifactid=vaadin-archetype-application -darchetypeversion=7.0.4 -dpackaging=war [info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building maven stub project (no pom) 1 [info] ------------------------------------------------------------------------ [info] [info] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>> [info] [info] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<< [info] [info] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom --- [info] generating project in interactive mode [info] archetype repository missing. using 1 [com.vaadin:vaadin-archetype-application:7.0.4] found in catalog remote define value property 'groupid': : maba define value property 'artifactid': : vaadin-app define value property 'version': 1.0-snapshot: : define value property 'package': maba: : confirm properties configuration: groupid: maba artifactid: vaadin-app version: 1.0-snapshot package: maba y: : [info] ---------------------------------------------------------------------------- [info] using following parameters creating project archetype: vaadin-archetype-application:7.0.4 [info] ---------------------------------------------------------------------------- [info] parameter: groupid, value: maba [info] parameter: artifactid, value: vaadin-app [info] parameter: version, value: 1.0-snapshot [info] parameter: package, value: maba [info] parameter: packageinpathformat, value: maba [info] parameter: package, value: maba [info] parameter: version, value: 1.0-snapshot [info] parameter: groupid, value: maba [info] parameter: artifactid, value: vaadin-app [info] project created archetype in dir: c:\dev\vaadin-app [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 28.122s [info] finished at: fri apr 19 08:05:49 cest 2013 [info] final memory: 12m/152m [info] ------------------------------------------------------------------------ c:\dev>
then step newly created directory , run mvn install
dependencies , have fresh start.
c:\dev\vaadin-app> mvn install [info] scanning projects... ... ------ lots of stuff going on ------ ... [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 3:30.373s [info] finished at: fri apr 19 08:13:07 cest 2013 [info] final memory: 24m/296m [info] ------------------------------------------------------------------------
now open project pointing newly created pom.xml
.
everything looks fine. choose configure gwt framework in green box in upper right corner.
now choose edit configurations...
drop-down.
choose gwt configuration
.
give name , choose module
drop-down.
now have option choose gwt module load
2 options @ moment.
i choose run application. in case give error.
this seems a known error @ moment. you'll have add vaadin-client-compiler.jar
classpath manually.
press project structure
button in toolbar.
select dependencies
tab vaadin-app
, choose add jars or directories...
.
navigate local maven repository , find vaadin-client-compiler-<version>.jar
.
on mac os , linux/unix, found at: ~/.m2/repository/com/vaadin/vaadin-client-compiler/7.0.4/...
press ok
, ok
again in project structure
window.
now once again run application. no more errors.
now, i'm not vaadin expert here you're on own.
have fun!
Comments
Post a Comment