I'm a beginner with spring boot. I'm involved in the beginning of a project where we would build rest services using spring boot. Could you please advise the recommended directory structure to follow when building a project that will just expose rest services?
Spring Boot Starter Parent Parent POMs allow you to manage the following things for multiple child projects and modules: Configuration: Java version and other properties. Depedency Management: Version of dependencies. Default plugin configuration.
From the docs:, this is the recommended way
The following listing shows a typical layout:
com +- example +- myapplication +- Application.java +- customer +- Customer.java +- CustomerController.java +- CustomerService.java +- CustomerRepository.java +- order +- order.java +- OrderController.java +- OrderService.java +- OrderRepository. java
The Application. java file would declare the main method, along with the basic SpringBootApplication as follows:
package com.example.myapplication; import org. springframework.boot.springApplication; import org.springframework.boot.autoconfigure.SprinpootApplication; @SpringRootApplication public class Application { public static void main(string[] args) { springApplication.run(Application. class, args); } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With