Directory | Description |
---|---|
src/main/java | Java source code |
src/main/resource | Properties/config files used by your app |
src/test/java | Unit testing soucre code |
mvnw.cmd: first thing mvnw.cmd file for window and mvnw.sh for Linux operating system.both files doing same work depending on the operating system . No need to have Maven installed or present on your path. If the Correct version of Maven is NOT Found on your computer. it Automatically Downloads correct Version and runs Maven if you have correct version install in your computer then delete .mvnw file form spring boot project
pom.xml includes info that you entered at Spring Initializr website
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-started-web</artifactId> </dependency> </dependencies> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-started-test</artifactId> </dependency> </dependencies>
Spring Boot Maven Plugin
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </dependency> </dependencies>
@springBootApplicatin:
(Enables) Auto Configuration, Component scanning ,Additional Configuration
Composed of following annotations
@EnableAutoConfiguration
@ComponentScan
@Configuration
@SpringBootApplication is composed of the following annotations:
Annotaion | Description |
---|---|
@EnableAutoConfiguration | Enables Spring Boot's auto-configuration support |
@ComponentScan | Enables component scanning of current package Also recursively scans sub-packages |
@Configuration | Able to register extra beans with @Bean or import other configuration classes |
@ComponentScan , @Configuration :Same annotaions that we've used before with traditional Springs Apps
package com.jbb.springboot.MySpringBootApp2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MySpringBootApp2Application { public static void main(String[] args) { SpringApplication.run(MySpringBootApp2Application.class, args); } }