のデモプロジェクトを作成しています Spring-Config-Server
そして Spring-Config-Client
.
に SpringBoot 1.5.6.RELEASE
すべてがうまくいっています。
ただし、プロジェクトをにアップグレードする場合 2.0.1.RELEASE
アクチュエータのエンドポイントは提供しません。
で提供されるアクチュエータエンドポイント 1.5.6。リリース
Mapped "{[/refresh || /refresh.json],methods=[POST]}"
Mapped "{[/dump || /dump.json],methods=[GET]
Mapped "{[/heapdump || /heapdump.json],methods=[GET]
Mapped "{[/autoconfig || /autoconfig.json],methods=[GET]
Mapped "{[/resume || /resume.json],methods=[POST]}"
Mapped "{[/configprops || /configprops.json],methods=[GET]
Mapped "{[/features || /features.json],methods=[GET]
Mapped "{[/loggers/{name:.*}],methods=[GET]
Mapped "{[/restart || /restart.json],methods=[POST]}"
...and many more
で提供されるアクチュエータエンドポイント 2.0.1。リリース
Mapped "{[/actuator/health],methods=[GET]
Mapped "{[/actuator/info],methods=[GET]
Mapped "{[/actuator],methods=[GET]
pom.xml : 2.0.1.RELEASE
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RC1</spring-cloud.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.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
唯一の違いbw 1.5.6
pomはバージョンであり spring-cloud.version = Dalston.SR2
誰かが助けてくれますか?
回答:
回答№1は2少し調べてみたところ、エンドポイントが表示されない原因が見つかりました。 Spring Boot 2.0
は ドキュメントによると
デフォルトでは、シャットダウンを除くすべてのエンドポイントが有効になっています
したがって、手動で有効にする必要があります。
私が追加しました management.endpoints.web.exposure.include=*
に application.properties
ファイルとすべてのエンドポイントが戻ってきました。
注意:使用している場合 .yml
必ず使用してください "*"
ない *
回答№2の場合は0
HTTPでのエンドポイントの公開は、プロパティを使用して構成できるようになりました
management.endpoints.web.exposure.include
management.endpoints.web.exposure.exclude
アクチュエーターによって言及されたIDによってエンドポイントを公開できます。
# Include all endpoints
management.endpoints.web.exposure.include=*
# Exclude specifics
management.endpoints.web.exposure.exclude=env