Recall & Review
beginner
What is the main class annotation to start a Spring Boot application?The main class should be annotated with <code>@SpringBootApplication</code>. This annotation enables auto-configuration, component scanning, and configuration support.Click to reveal answer
beginner
How do you run a Spring Boot application from the command line using Maven?
Use the command
mvn spring-boot:run in the project directory. This compiles and runs the application without needing to build a jar first.Click to reveal answer
beginner
What method is used to launch the Spring Boot application in the main class?
The method
SpringApplication.run(MainClass.class, args) is called inside the main method to start the application.Click to reveal answer
beginner
What file is commonly used to configure Spring Boot application properties?
The
application.properties or application.yml file in the src/main/resources folder is used to configure settings like server port, database, and logging.Click to reveal answer
intermediate
How can you package a Spring Boot application to run it as a standalone jar?
Use
mvn clean package to build a jar file in the target folder. Run it with java -jar target/appname.jar to start the app.Click to reveal answer
Which annotation marks the main class to enable Spring Boot features?
✗ Incorrect
The @SpringBootApplication annotation combines @EnableAutoConfiguration, @ComponentScan, and @Configuration for convenience.
What command runs a Spring Boot app using Maven without building a jar?
✗ Incorrect
The mvn spring-boot:run command compiles and runs the app directly.
Where do you place application configuration files in a Spring Boot project?
✗ Incorrect
Configuration files like application.properties go in src/main/resources.
Which method starts the Spring Boot application inside the main class?
✗ Incorrect
SpringApplication.run() launches the Spring Boot app.
How do you run a packaged Spring Boot jar file?
✗ Incorrect
Use java -jar followed by the jar file path to run the packaged app.
Explain the steps to run a Spring Boot application from source code using Maven.
Think about the main class setup and the Maven command to start the app.
You got /3 concepts.
Describe how to package and run a Spring Boot application as a standalone jar.
Focus on building and running the jar file.
You got /3 concepts.