You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getting-started-idea.asciidoc 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ---
  2. title: Creating a Project in IntelliJ
  3. order: 120
  4. layout: page
  5. ---
  6. [[getting-started.idea]]
  7. = Creating a Project with IntelliJ IDEA
  8. With both Community Edition and Ultimate Edition, you can create a Vaadin application most easily with a Maven archetype and deploy it to a server with a Maven run/debug configuration.
  9. [[getting-started.idea.maven]]
  10. == Creating a Maven Project
  11. You can choose to create a Maven project in IntelliJ IDEA. You will not have the
  12. application server integration, but can deploy the application to an application
  13. server using a run/debug configuration.
  14. . Select [menuchoice]#New Project#
  15. . In the [guilabel]#New Project# window, select [menuchoice]#Maven#
  16. //<?dbfo-need height="8cm" ?>
  17. . Select the Java SDK to be used for the project. Vaadin requires at least Java 8.
  18. . Check [guilabel]#Create from archetype# checkbox
  19. . If the Vaadin archetype is not in the list, click [guibutton]#Add archetype#,
  20. enter [guilabel]#GroupId# [literal]#++com.vaadin++#, [guilabel]#ArtifactId#
  21. [literal]#++vaadin-archetype-application++#, and [guilabel]#Version#
  22. [literal]#++LATEST++# (or a specific version number).
  23. +
  24. Click [guibutton]#OK# in the dialog.
  25. //<?dbfo-need height="8cm" ?>
  26. . Select the archetype
  27. +
  28. image::img/idea-maven-newproject-1.png[scaledwidth=100%]
  29. +
  30. Click [guibutton]#Next#.
  31. //<?dbfo-need height="6cm" ?>
  32. . Give a Maven [guilabel]#GroupID#, [guilabel]#ArtifactID#, and a
  33. [guilabel]#Version# for the project, or use the defaults.
  34. . Review the general Maven settings and settings for the new project.
  35. You may need to override the settings, especially if you are creating a Maven project for the first time.
  36. . Finish the wizard.
  37. //<?dbfo-need height="8cm" ?>
  38. Creating the Maven project takes some time as Maven fetches the dependencies.
  39. Once done, the project is created and the Maven POM is opened in the editor.
  40. Fort more detailed instructions, refer to https://www.jetbrains.com/help/idea/
  41. [[getting-started.idea.maven.compiling]]
  42. === Compiling the Project
  43. To compile a Vaadin application using Maven, you can define a run/debug
  44. configuration to execute a goal such as [literal]#++package++# to build the
  45. deployable WAR package. It will also compile the widget set and theme, if
  46. necessary. See
  47. <<dummy/../../../framework/getting-started/getting-started-maven#getting-started.maven.compiling,"Compiling
  48. and Running the Application">> for more details.
  49. Compilation is included in the following instructions for deploying the
  50. application.
  51. [[getting-started.idea.maven.deploying]]
  52. === Deploying to a Server
  53. There exists Maven plugins for deploying to various application servers. For
  54. example, to deploy to Apache Tomcat, you can to configure the
  55. [literal]#++tomcat-maven-plugin++# and then execute the
  56. [literal]#++tomcat:deploy++# goal. See the documentation of the plugin that you
  57. use for more details. If no Maven plugin exists for a particular server, you can
  58. always use some lower-level method to deploy the application, such as running an
  59. Ant task.
  60. In the following, we create a run/debug configuration to build, deploy, and
  61. launch a Vaadin Maven application on the light-weight Jetty web server.
  62. . Select "Run > Edit Configurations".
  63. . Click [guibutton]#+# and select menu:Maven[] to create a new Maven run/debug configuration.
  64. . Enter a [guilabel]#Name# for the run configuration.
  65. For the [guilabel]#Command line#, enter "`package jetty:run`# to first compile and package the project, and then launch Jetty to run it.
  66. +
  67. Click [guibutton]#OK#.
  68. . Select the run configuration in the toolbar and click the [guibutton]#Run#
  69. button beside it.
  70. Compiling the project takes some time on the first time, as it compiles the
  71. widget set and theme. Once the run console pane informs that Jetty Server has
  72. been started, you can open the browser at the default URL
  73. http://localhost:8080/.