This project can be used as a starting point to create your own Vaadin application with Spring Boot. It contains all the necessary configuration and some placeholder files to get you started.
The best way to create your own project based on this starter is start.vaadin.com - you can get only the necessary parts and choose the package naming you want to use.
While developing the application, it is recommended to launch the Application
class in debug mode from your IDE.
After the application has started, you can view your it at http://localhost:8080/ in your browser.
Open the Application class, right click on it and select "Debug as..." --> "Java Application"
Open the Application class, right click on it and select "Debug 'Application.main()'"
From the command line you can use ./mvnw spring-boot:run
to run your application.
You should not launch the Maven spring-boot:run
target from your IDE as it will prevent breakpoints and debugging from working because it forks a new process. It might also prevent the server from being shut down properly, especially in Eclipse.
If you want to run the application in the production mode, use ./mvnw spring-boot:run -Pproduction
.
For advanced cases it can be useful to run the application from command line and attach to it from an IDE when you want to debug something. The project is set up to listen for a debug connection on port 5005 out of the box so if you run ./mvnw spring-boot:run
you can connect by adding a remote Java launch configuration to your IDE.
Integration tests are implemented using Vaadin TestBench. The tests take a few minutes to run and are therefore included in a separate Maven profile. We recommend running tests with a production build to minimize the chance of development time toolchains affecting test stability. To run the tests using Google Chrome, execute
mvn verify -Pit,production
and make sure you have a valid TestBench license installed.
Profile it
adds the following parameters to run integration tests:
-Dwebdriver.chrome.driver=path_to_driver
-Dcom.vaadin.testbench.Parameters.runLocally=chrome
If you would like to run a separate test make sure you have added these parameters to VM Options of JUnit run configuration
With live reload, you can see the results of your code changes immediately. When you edit your Java code and recompile it, the application changes will be automatically reloaded and the browser is refreshed. This is done by leveraging Spring Boot Developer Tools. To be able to see the changes in the browser tab, the page still needs to be reloaded. That can also be automated via a LiveReload browser extension. One such extension for Google Chrome is LiveReload. In Firefox, LiveReload - Web extension can be used. You can find such similar extensions for other major browsers too. These extensions add an icon to your browser next to the address bar. To enable the extension, you should click that icon after you opened your application.
You can find more information at Live Reload in Spring Boot Applications document.
Vaadin web applications are full-stack and include both client-side and server-side code in the same project.
Directory | Description |
---|---|
frontend/ |
Client-side source directory |
index.html |
HTML template |
index.ts |
Frontend entrypoint |
main-layout.ts |
Main layout Web Component (optional) |
views/ |
UI views Web Components (TypeScript / HTML) |
styles/ |
Styles directory (CSS) |
src/main/java/<groupId>/ |
Server-side source directory |
Application.java |
Server entrypoint |
AppShell.java |
application-shell configuration |
- Read the documentation at vaadin.com/docs.
- Follow the tutorials at vaadin.com/tutorials.
- Watch training videos and get certified at vaadin.com/learn/training.
- Create new projects at start.vaadin.com.
- Search UI components and their usage examples at vaadin.com/components.
- View use case applications that demonstrate Vaadin capabilities at vaadin.com/examples-and-demos.
- Discover Vaadin's set of CSS utility classes that enable building any UI without custom CSS in the docs.
- Find a collection of solutions to common use cases in Vaadin Cookbook.
- Find Add-ons at vaadin.com/directory.
- Ask questions on Stack Overflow or join our Discord channel.
- Report issues, create pull requests in GitHub.