static void main(String[] args) { SpringApplication.run(Main.class, args); } } Enable Spring Boot Configuration e.g. Web environment etc Scan for Spring annotations e.g. @Component @Configuration etc In this package and all sub packages Start application e.g. Tomcat, Spring web environment etc @SpringBootApplication = @ComponentScan+ @EnableAutoConfiguration+ @Configuration
</parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> ... </dependencies> Configuration inherits from parent Sets versions for dependencies Add all needed libs for a web app Many starters available
{ List<Customer> findByName(String name); } Defines all basic CRUD (Create, Read, Update, Delete) operations Implementation created by naming convention Add Spring Boot Starter Data JPA No further configuration Without Spring Boot <repositories base-package="de.project" /> or @EnableJpaRepositories("de.project")