Spring Initializr is a project configurator that you can use to kickstart your application project. You can use it directly from the web page, but there are also IDE integrations, Spring Boot CLI or simply command line curl
to get started. You can just check the libraries and e.g. DB that you are going to use, choose the Java version and build system and then download a project stub as a zip file. You could think Spring Initializr kind of as an archetype on steroids.
Those using it often might have already seen a new option available for Vaadin. In practice this option adds Vaadin Spring dependencies to your project so you have a good starting point for your the Vaadin Spring Boot applications.
Generate a project right from the command line:
curl https://start.spring.io/starter.zip -d dependencies=vaadin -d baseDir=vaadin-demo -o vaadin-demo.zipAnd here is a brief example of a service and Vaadin UI class for you to start with:
@SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } @Service public static class MyService { public String sayHi() { return "Hello Spring Initializr!"; } } @Theme("valo") @SpringUI(path = "") public static class VaadinUI extends UI { @Autowired MyService myService; @Override protected void init(VaadinRequest request) { setContent(new Label(myService.sayHi())); } } }
Along the way, we have updated our Spring tutorial as well to use the Spring Initializr to kickstart the application project.