SpringBoot1.5.6 actuator不好使

来源:互联网 发布:windows自带软件 编辑:程序博客网 时间:2024/04/30 04:44
pom.xml
<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 http://maven.apache.org/maven-v4_0_0.xsd">  <modelVersion>4.0.0</modelVersion>  <groupId>com.xxxx</groupId>  <artifactId>springboot</artifactId>  <packaging>war</packaging>  <version>1.0-SNAPSHOT</version>  <name>springboot Maven Webapp</name>  <url>http://maven.apache.org</url>  <properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    <maven.compiler.source>1.8</maven.compiler.source>    <maven.compiler.target>1.8</maven.compiler.target>  </properties>  <dependencyManagement>    <dependencies>      <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-dependencies</artifactId>        <version>1.5.6.RELEASE</version>        <scope>import</scope>        <type>pom</type>      </dependency>    </dependencies>  </dependencyManagement>  <dependencies>    <dependency>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-web</artifactId>    </dependency>    <dependency>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-actuator</artifactId>    </dependency>  </dependencies>  <build>    <finalName>springboot</finalName>  </build></project>

其他没有做任何配置

然后启动springboot 在浏览器中输入   http://127.0.0.1:8080/beans 出现如下页面


然后我把springboot的版本 切换成1.41. 其他的不坐任何改动 发现是可以的


然后将版本切回1.5.6 启动之后 仔细查看控制台

Full authentication is required to access actuator endpoints. Consider adding Spring Security or set 'management.security.enabled' to false.

按照提示在application.properties 添加management.security.enabled =false 就OK了

原创粉丝点击