In a spring boot 2 application I'm trying to access actuator endpoint /beans as I did before in Spring boot 1.5.* applications. But I'm unable to. Also, I don't see the endpoint is being created in the log.INFO.
My pom.xml contains:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
in application.properties I only have info about the databaseconnectivity:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/somedb
spring.datasource.username=someuser
spring.datasource.password=somepass
As mapped endpoints I see in the info logs:
/actuator/health
/actuator/info
/actuator
The application is working but no /application/beans endpoint is created.
How come my /beans or /application/beans endpoint is not generated and what should I change to make it exist?
According to the reference documentation this endpoint is no longer exposed via "web" by default.
First, you need to make sure that the "beans" endpoint is actually enabled:
management.endpoint.beans.enabled=true
in your spring-boot-configuration. Then, you need to include it in the "web" exposure:
management.endpoints.web.exposure.include=beans
or maybe even
management.endpoints.web.exposure.include=*
See https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#production-ready-endpoints-enabling-endpoints for further information.