Preface
Intellij IDEA 2017.2.2 version sets some features for Springboot. This article briefly introduces how to use these features.
Run Dashboard
Spring boot provides Run Dashboard method instead of the traditional run method. Let’s take a look at the panel structure diagram provided by the official website:
Isn't it very cool? You can directly see the Springboot startup project through Dashboard and display the corresponding port and other information. At the same time, you can also perform corresponding operations here. Let's take a look at how to call Dashboard.
First of all, your project should be a springboot project. Then enter Edit configurations, click the + sign, find the springboot option, and add a springboot configuration.
Then configure, name, Main class (the startup class containing the main method), working directory, Use classpath of module, jre, etc.
The most important thing is to fit whether the Show in Run Dashboard is checked below. If it is not checked, check it.
This completes the configuration of this new feature. Try it. The effect is the same as that provided by the official website.
Actuator endpoints
After starting springboot through the above steps, you will find that an Endpoints tab item appears on the right. This item also includes Health, Beans, and Mappings.
For example, Mappings can display the request address and other information exposed by Springboot. You can try the specific functions yourself. However, before using this function, you need to configure the corresponding dependencies in the pom file.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>1.2.3.RELEASE</version> </dependency>
Summarize
The above is the introduction of Spring Boot related features of Intellij IDEA 2017 new features introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to Wulin.com website!