Now, run the JAR file by using the command shown here − You can create an executable JAR file, and run the Spring Boot application by using the following Maven or Gradle commands.įor Maven, you can use the command shown here −Īfter “BUILD SUCCESS”, you can find the JAR file under the target directory.įor Gradle, you can use the command as shown here −Īfter “BUILD SUCCESSFUL”, you can find the JAR file under the build/libs directory. We need to define the base package to configure REST API(s) for Docket productApi() ")Ĭompile(':spring-boot-starter-web') ![]() Next, create Docket Bean to configure Swagger2 for your Spring Boot application. The code for main Spring Boot application is shown below − The annotation is used to enable the Swagger2 for your Spring Boot application. ![]() Now, add the annotation in your main Spring Boot application. To enable the Swagger2 in Spring Boot application, you need to add the following dependencies in our build configurations file.įor Gradle users, add the following dependencies in your adle file.Ĭompile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0'Ĭompile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0' It provides a user interface to access our RESTful web services via the web browser. Swagger2 is an open source project used to generate the REST API documents for RESTful web services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |