创建Application.yml文件后,Spring-boot使用默认设置

时间:2019-04-22 19:54:56

标签: spring-boot yaml

为我的服务器创建application.yml文件后,服​​务器无法加载到我的自定义安全协议或登录页面中。例如,当我导航到登录URL时,它仅显示默认的Spring登录。当我在URL上执行get请求时,我的浏览器无法找到它。另外,以前没有起作用的路线现在都无法起作用。这是Yaml的样子:

  mfaas:
      discovery:
          serviceId: ${environment.serviceId}
          locations: ${environment.discoveryLocations}
          enabled: ${environment.discoveryEnabled:true}
          endpoints:
              statusPage: ${mfaas.server.scheme}://${mfaas.service.hostname}:${mfaas.server.port}${mfaas.server.contextPath}/application/info
              healthPage: ${mfaas.server.scheme}://${mfaas.service.hostname}:${mfaas.server.port}${mfaas.server.contextPath}/application/health
              homePage: ${mfaas.server.scheme}://${mfaas.service.hostname}:${mfaas.server.port}${mfaas.server.contextPath}/
          info:
              serviceTitle:  ${environment.serviceTitle}
              description:  ${environment.serviceDescription}
              # swaggerLocation: resource_location_of_your_static_swagger_doc.json
          fetchRegistry: false
          region: default
      service:
          hostname: ${environment.hostname}
          ipAddress: ${environment.ipAddress}
      catalog-ui-tile:
          id: yourProductFamilyId
          title: Your API service product family title in the API catalog dashboard tile
          description: Your API service product family description in the API catalog dashboard tile
          version:  1.0.0
      server:
          scheme: http
          port: ${environment.port}
          contextPath: /yourServiceUrlPrefix

  eureka:
      instance:
          appname: ${mfaas.discovery.serviceId}
          hostname: ${mfaas.service.hostname}
          statusPageUrlPath: ${mfaas.discovery.endpoints.statusPage}
          healthCheckUrl: ${mfaas.discovery.endpoints.healthPage}
          homePageUrl: ${mfaas.discovery.endpoints.homePage}
          metadata-map:
              routed-services:
                  api_v1:
                      gateway-url: "api/v1"
                      service-url: ${mfaas.server.contextPath}
              apiml:
                  apiInfo:
                      - apiId: ${mfaas.discovery.serviceId}
                        gatewayUrl: api/v1
                        swaggerUrl: ${mfaas.server.scheme}://${mfaas.service.hostname}:${mfaas.server.port}${mfaas.server.contextPath}/api-doc
                        documentationUrl: https://www.zowe.org
              mfaas:
                  api-info:
                      apiVersionProperties:
                          v1:
                              title: Your API title for swagger JSON which is displayed in API Catalog / service / API Information
                              description: Your API description for swagger JSON
                              version: 1.0.0
                              basePackage: your.service.base.package.for.swagger.annotated.controllers
                              # apiPattern: /v1/.*  # alternative to basePackage for exposing endpoints which match the regex pattern to swagger JSON
                  discovery:
                      catalogUiTile:
                          id: ${mfaas.catalog-ui-tile.id}
                          title:  ${mfaas.catalog-ui-tile.title}
                          description: ${mfaas.catalog-ui-tile.description}
                          version: ${mfaas.catalog-ui-tile.version}
                      enableApiDoc: ${mfaas.discovery.info.enableApiDoc:true}
                      service:
                          title: ${mfaas.discovery.info.serviceTitle}
                          description: ${mfaas.discovery.info.description}
      client:
          enabled: ${mfaas.discovery.enabled}
          healthcheck:
              enabled: true
          serviceUrl:
              defaultZone: ${mfaas.discovery.locations}
          fetchRegistry:  ${mfaas.discovery.fetchRegistry}
          region: ${mfaas.discovery.region}

  server:
      # address: ${mfaas.service.ipAddress}
      port: ${mfaas.server.port}
      servlet:
          contextPath: ${mfaas.server.contextPath}

  spring:
      application:
          name: ${mfaas.discovery.serviceId}

我需要使用特定设置来使用我的自定义安全性吗?

0 个答案:

没有答案