赞
踩
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <build>
- <finalName>microservicecloud</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <configuration>
- <delimiters>
- <delimit>$</delimit>
- </delimiters>
- </configuration>
- </plugin>
- </plugins>
- </build>

所有 src/main/resources下的$XXXX$配置的信息都可以访问
- eureka:
- client: #客户端注册进eureka服务列表内
- service-url:
- defaultZone: http://localhost:7001/eureka
- instance:
- instance-id: microservicecloud-dept8001 #自定义服务名称信息
- prefer-ip-address: true #访问路径可以显示IP地址
-
- info:
- app.name: zhq-microservicecloud
- company.name: www.zhq.com
- build.artifactId: $project.artifactId$
- build.version: $project.version$
其中instance配置修改了服务器名称和ip,info定义了 actuator的info端口访问的内容
1)、配置前
2)、配置后
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。