Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Latest commit

 

History

History
72 lines (53 loc) · 2.91 KB

Vaadin-README.md

File metadata and controls

72 lines (53 loc) · 2.91 KB

Vaadin Gradle Skeleton Starter

This project demos the possibility of having Vaadin project in npm+webpack mode using Gradle. Please see the Starting a Vaadin project using Gradle for the documentation.

Prerequisites:

  • Java 8 or higher
  • node.js and npm. You can either let the Vaadin Gradle plugin to install nodejs and npm/pnpm for you automatically, or you can install it to your OS:
  • Git
  • (Optionally): Intellij Ultimate

Building In Production Mode

Simply run the following command in this repo:

./gradlew clean build -Pvaadin.productionMode

That will build this app in production mode as a WAR archive; please find the WAR file in build/libs/base-starter-gradle.war. You can run the WAR file by using Jetty Runner:

cd build/libs/
wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-runner/9.4.26.v20200117/jetty-runner-9.4.26.v20200117.jar
java -jar jetty-runner-9.4.26.v20200117.jar base-starter-gradle.war

Now you can open the http://localhost:8080 with your browser.

Building In Production On CI

Usually the CI images will not have node.js+npm available. Luckily Vaadin will download nodejs and npm/pnpm automatically, there is nothing you need to do. To build your app for production in CI, just run:

./gradlew clean build -Pvaadin.productionMode

Running/Debugging In Intellij Ultimate With Tomcat in Development Mode

  • Download and unpack the newest Tomcat 9.
  • Open this project in Intellij Ultimate.
  • Click "Edit Launch Configurations", click "Add New Configuration" (the upper-left button which looks like a plus sign +), then select Tomcat Server, Local. In the Server tab, the Application Server will be missing, click the "Configure" button and point Intellij to the Tomcat directory.
    • Still in the launch configuration, in the "Deployment" tab, click the upper-left + button, select "Artifact" and select base-starter-gradle.war (exploded).
    • Still in the launch configuration, name the configuration "Tomcat" and click the "Ok" button.

Now make sure Vaadin is configured to be run in development mode - run:

./gradlew clean vaadinPrepareFrontend
  • Select the "Tomcat" launch configuration and hit Debug (the green bug button).

If Tomcat fails to start with Error during artifact deployment. See server log for details., please:

  • Go and vote for IDEA-178450.
  • Then, kill Tomcat by pressing the red square button.
  • Then, open the launch configuration, "Deployment", remove the (exploded) war, click + and select base-starter-gradle.war.