Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java /执行器/信息端点不适用于弹簧靴2.5.0_Java_Spring_Spring Boot - Fatal编程技术网

Java /执行器/信息端点不适用于弹簧靴2.5.0

Java /执行器/信息端点不适用于弹簧靴2.5.0,java,spring,spring-boot,Java,Spring,Spring Boot,我在我的应用程序中将spring引导版本从2.4.4升级到2.5.0,它停止暴露/exactor/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.

我在我的应用程序中将spring引导版本从2.4.4升级到2.5.0,它停止暴露/exactor/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>

management:
  endpoints:
    jmx:
      exposure:
        include: "health,info"

使用spring boot父版本2.4.4,应用程序可以公开info端点,但不能使用2.5.0。

通过http公开启动器URL的正确属性是
management.endpoints.web。​暴露。排除(
web
而不是
jmx


在您的情况下,
info
较早地被公开,不是因为您拥有所提供的属性,而是因为它在默认情况下被公开(以及
health
)。但是在2.5.0中,现在需要手动公开它。

通过http公开启动器URL的正确属性是
management.endpoints.web。​暴露。排除(
web
而不是
jmx

在您的情况下,
info
较早地被公开,不是因为您拥有所提供的属性,而是因为它在默认情况下被公开(以及
health
)。但是在2.5.0中,现在需要手动公开它