zoukankan      html  css  js  c++  java
  • springboot admin邮件报警

    admin-server pom

    <?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>org.example</groupId>
        <artifactId>mypingadmin</artifactId>
        <version>1.0-SNAPSHOT</version>
    
        <parent>
            <artifactId>spring-boot-parent</artifactId>
            <groupId>org.springframework.boot</groupId>
            <version>2.2.0.RELEASE</version>
        </parent>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-server</artifactId>
                <version>2.2.0</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-mail</artifactId>
            </dependency>
        </dependencies>
    </project>

    配置文件

    server:
      port: 8081
    
    spring:
      application:
        name: mypingadmin
      mail:
        host: smtp.qq.com
        username: 1090@qq.com
        password: lsdjkflskafjlkd#qq邮箱授权码
        properties:
          mail:
            debug: false
            smtp:
              auth: true
              starttls:
                enable: true
                required: true
    
      boot:
        admin:
          ui:
            title: SpringBootAdmin-Server
          notify:
            mail:
              to: 45645@qq.com
              from: 1090@qq.com

    admin-client pom

    <?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>org.example</groupId>
        <artifactId>myping</artifactId>
        <version>1.0-SNAPSHOT</version>
    
        <parent>
            <artifactId>spring-boot-parent</artifactId>
            <groupId>org.springframework.boot</groupId>
            <version>2.2.0.RELEASE</version>
        </parent>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-client</artifactId>
                <version>2.2.0</version>
            </dependency>
        </dependencies>
    
        <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>
            <elasticsearch.version>7.6.2</elasticsearch.version>
        </properties>
    </project>
    server:
      port: 8080
    spring:
      application:
        name: myping
      profiles:
        active: test
      boot:
        admin:
          client:
            url: http://localhost:8081
    
    management:
      endpoints:
        web:
          exposure:
            include: '*'
      endpoint:
        health:
          show-details: ALWAYS

  • 相关阅读:
    VUE脚手架,babel转码 常用命令
    ES6那些事半功倍的新特性(一)
    vuex中怎么把‘库’中的状态对象赋值给内部对象(三种方法)
    VUE自定义指令生命周期,VUE生命周期
    判断是数组还是对象的方法
    利用cordova打包H5混合app
    webstorm皮肤外观样式快速设置,CMD的使用方法,webstorm11激活方法
    数组操作方法中的splice()和concat() 以及slice()
    Angularjs跨域
    Node.js的基础知识(一)
  • 原文地址:https://www.cnblogs.com/gqymy/p/13305966.html
Copyright © 2011-2022 走看看