我将我的应用程序中的spring引导版本从2.4.4升级到了2.5.0,它停止了公开/驱动器/info端点。这是pom.xml和application.yml
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ms</groupId>
<artifactId>spring-boot-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot-test</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<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-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>application.yml
management:
endpoints:
jmx:
exposure:
include: "health,info"使用spring父版本2.4.4,应用程序能够公开info端点,但不能公开2.5.0。
发布于 2021-06-08 20:11:12
在http上公开执行器urls的正确属性是management.endpoints.web.exposure.exclude (web而不是jmx)。
在您的示例中,info在早期公开并不是因为您拥有所提供的属性,而是因为默认情况下它是公开的(与health一起)。但是在2.5.0 它变得隐匿起来中,现在需要手动公开它。
发布于 2021-11-26 08:59:03
将其添加到应用程序属性以公开/info端点。
management.info.env.enabled = true发布于 2021-09-06 11:52:04
在我的例子中,这是一个愚蠢的错误,我有以下依赖性:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>而不是:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>因此,我继续获得所有/actuator调用中找不到的白色标记错误页404。
在application.properties中
#Actuator
management.endpoints.jmx.exposure.include=health,info,env,beans
management.endpoints.web.exposure.include=health,info,env,beanshttps://stackoverflow.com/questions/67893857
复制相似问题