Spring / Spring Boot 4 Basics Interview Questions
What is the Spring Boot starter parent (POM) and how do you set up a Spring Boot 4 project?
The spring-boot-starter-parent POM sets sensible defaults for Maven builds: Java version, encoding, plugin versions, and dependency management via the Spring Boot BOM. It is the recommended way to start a Spring Boot project.
<!-- Maven: spring-boot-starter-parent --> <project> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>4.1.0</version> <!-- Spring Boot 4.1 (current) --> <relativePath/> </parent> <groupId>com.example</groupId> <artifactId>order-service</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> <java.version>17</java.version> <!-- minimum for Boot 4 --> </properties> <dependencies> <!-- Spring Boot 4 modular starters --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webmvc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <!-- includes JUnit 5 (Jupiter only in Boot 4) --> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <!-- builds executable JAR with embedded Tomcat --> </plugin> </plugins> </build> </project>
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
