[Java] 纯文本查看 复制代码
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.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>
<mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version>
</properties>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.4.6</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.4.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.SR5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[Java] 纯文本查看 复制代码
@Configuration
@EnableAutoConfiguration
@EnableDiscoveryClient
@EnableAdminServer
public class AdminserverApplication {
public static void main(String[] args) {
SpringApplication.run(AdminserverApplication.class, args);
}
}
[Java] 纯文本查看 复制代码
# 解决windows下运行时无法识别主机名的问题
spring.boot.admin.client.prefer-ip=true
server.port=7086
spring.application.name=zk_admin
eureka.instance.preferIpAddress=true
eureka.client.service-url.defaultZone=http://172.16.1.28:7082/eureka/,http://172.16.1.29:7082/eureka/
#定义各种额外的详情给服务端显示
#从pom.xml中获取
info.app.name="@project.name@"
info.app.description="@project.description@"
info.app.version="@project.version@"
info.spring-boot-version="@project.parent.version@"
info.version=@project.version@
#宕机邮件提示
spring.mail.host=smtp.126.com
spring.mail.username=****
spring.mail.password=*****
spring.boot.admin.notify.mail.from=*****
spring.boot.admin.notify.mail.to=******
management.security.enabled=false
management.security.roles=SUPERUSER
security.user.name=xjgz2018
security.user.password=xjgz2018.
security.basic.enabled=false
#开启shutdown的安全验证
endpoints.health.sensitive= true
endpoints.cors.allowed-methods=HEAD,GET,POST
#启用shutdown
endpoints.shutdown.enabled=true
#禁用密码验证
endpoints.shutdown.sensitive=false