Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Latest commit

 

History

History
132 lines (98 loc) · 6.53 KB

installing-overview.asciidoc

File metadata and controls

132 lines (98 loc) · 6.53 KB
title order layout
Overview
1
page

Overview

Vaadin applications are written in Java, and optionally HTML, JavaScript, or TypeScript. You can develop Vaadin applications in essentially any development environment that has the Java SDK and deploys to a Java Servlet container. You can use Vaadin with any Java IDE or no IDE at all. Vaadin has special support for the Eclipse, NetBeans, and IntelliJ IDEA IDEs.

Vaadin installation steps

installation steps

Required Tools

You need at least the following tools during application development:

  • Java JDK (8 or newer)

  • Maven (3 or newer) or Gradle (5.6 or newer)

  • Node.js (10 or newer, installed automatically by Vaadin 14.2+)

  • npm (5.6 or newer, installed automatically by Vaadin 14.2+)

While Java 8 is supported, we recommend using Java 11 (the latest LTS version) or later, but you need to make sure that your entire toolchain supports it.

Optionally, you can use:

  • A Java IDE (Eclipse EE, NetBeans IDE, IntelliJ IDEA, VS Code, etc.)

  • A front-end IDE such as VS Code, WebStorm, or Atom

  • An external Java Servlet Container (Tomcat, TomEE, JBoss, Wildfly, Glassfish, etc)

For a particular version of the Vaadin Framework, please see the release notes for a more comprehensive list of requirements.

Running an Application Locally

Vaadin applications are run by deploying them to a Java Servlet Container (a server application). All Vaadin starter packs come with an embedded servlet container that can be used during development. You can also use an external servlet container, such as Tomcat, Wildfly, or WebLogic. IDEs include integration with external containers and one can make debugging easier, and more compatible if you use the same one for production.

Managing Dependencies

Managing Vaadin and other Java libraries can get tedious to do manually, so using a build system that manages dependencies automatically is recommended. Vaadin is distributed in the Maven central repository, and can be used with any build or dependency management system that can access Maven repositories, such as Ivy or Gradle, in addition to Maven.

The npm package manager is used for managing Vaadin frontend JavaScript dependencies.

Automatic Installation of Frontend Toolchain

Since Vaadin 14.2, Vaadin automatically downloads and installs (via its Maven plugin) supported versions of Node.js and npm into the ~/.vaadin directory in the user’s home, unless it detects that these tools are already installed globally. If installed globally, Vaadin validates that the installed tools are of valid versions.

Other frontend tooling used by Vaadin, such as Webpack and pnpm, are installed locally into each project by npm. pnpm is a caching package manager that reduces the download time across multiple projects.

Older platform versions in the 14 series still require manual installation of Node.js, either globally or in the project directory (the Maven plugin will inform how to do this in a single command if it detects missing tools). Node.js can be downloaded from https://nodejs.org/en/download/ and installing it automatically installs npm as well.

Proxy Settings for Downloading Frontend Toolchain

If you are behind a proxy server you should config your proxy settings so Vaadin can use them to download the frontend toolchain. There are four places where Vaadin read proxy settings from. You can set your proxy data in either of the followings:

  1. system properties:

  2. {project directory}/.npmrc file

  3. {user home directory}/.npmrc file

  4. environment variables

The settings are read from the list above in order. For example, if you set your proxy in system properties, other sources will be ignored. The keys that you should use to define your proxy settings are as follows:

In System Properties and Environment Variables

In .npmrc files

Description

HTTP_PROXY

proxy

a proxy to use for outgoing http requests

HTTPS_PROXY

https-proxy

a proxy to use for outgoing https requests

NOPROXY

noproxy

a comma-separated string of domain extensions that a proxy should not be used for

.npmrc file structure is ini (like Java properties files). It includes pairs of key-values separated by =. Here is an example of the content of such a file with proxy settings:

proxy=http://myusername:s3cr3tpassw0rd@proxyserver1:8085"
https-proxy=http://myusername:s3cr3tpassw0rd@proxyserver1:8086"
noproxy=192.168.1.1,vaadin.com,mycompany.com

To learn more about .npmrc file you can see official npmrc document.

Building an Application using Travis CI

If you are using Travis as a Continuous Integration server then there are two different options to install a proper Node.js version: * Specify the version via Travis configuration in .travis.yml * Install node automatically by Vaadin (14.2+)

Please refer to Specifying Node.js versions in Travis docs how to specify the Node version via .travis.yml file.

Vaadin (14.2+) automatically installs node if it can’t be found. It downloads and installs 12.16.0 version. But it happens only if there is no node found. You may force node installation to the .vaadin folder inside a home directory via require.home.node property. This property sets the maven requireHomeNodeExec parameter value, so you may configure the maven goal using <requireHomeNodeExec>true</requireHomeNodeExec>. To be able to force node installation into home directory in dev mode you should use vaadin.require.home.node system property or require.home.node web init parameter.