Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
book-of-vaadin.pdf
Скачиваний:
88
Добавлен:
24.03.2015
Размер:
13.43 Mб
Скачать

Getting Started with Vaadin

The easiest way to run Vaadin applications with Maven is to use the light-weight Jetty web server. After compiling the package, all you need to do is type:

$ mvn jetty:run

The special goal starts the Jetty server in port 8080 and deploys the application. You can then open it in a web browser at http://localhost:8080/project-name.

2.6.3. Using Add-ons and Custom Widget Sets

If you use Vaadin add-ons that include a widget set or make your custom widgets, you need to enable widget set compilation in the POM.The required configuration is described in Section 17.4, “Using Add-ons in a Maven Project”.

2.7. Creating a Project with NetBeans IDE

You have two choices to create a Vaadin project in NetBeans: as a regular web application project or as a Maven project. We cover these both ways in the following sections.

2.7.1. Maven Project from a Vaadin Archetype

Creating a Maven project with a Vaadin archetype is simpler than a normal web application project in NetBeans. It creates an application skeleton, defines the web.xml deployment descriptor, and also retrieves the latest Vaadin library automatically.

1. Select File New Project.

2. Select Maven Project from Archetype and click Next.

3.Find vaadin-archetype-application, select it, and click Next.

4.In the Name and Location step, enter Project Name, which is recommended to be only lower-case alphabetics, as it is used also as a suggestion for the Java package name of the project. Modify the other parameters for your project and click Finish.

Figure 2.9. Adding a New Maven Project in NetBeans

Creating the project can take a while as Maven loads all the needed dependencies. Once created, you can run it by right-clicking on the project in the Projects view and selecting Run. In the Select

48

Using Add-ons and Custom Widget Sets

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]