spring - 带有 SVN 和默认标签的 Spring Cloud 配置服务器纯文本 api
问题描述
我有 spring boot 2 应用程序,它充当具有以下属性的配置服务器。特别注意“默认标签”属性,它是空字符串,因为我们直接检查包含文件的文件夹,而不是某些父分支/文件夹。
spring:
application:
name: config-server
profiles:
include: subversion
cloud:
config:
server:
svn:
uri: https://...somesvnrepo.../project/trunk/config
username: abc
password: 123
default-label:
basedir: C:\Users\Tom\Documents\MtgLemon\configserver_tmp
/trunk/config 的内容是直截了当的。没有子目录,只有这些文件:
- 应用程序.yml
- 应用程序-dev.yml
- 我的服务.yml
- 我的服务-dev.yml
- logback.xml
提供 yml 文件可以正常工作,但使用“纯文本 api ”获取 logback.xml 文件根本不起作用。
这样做localhost:8888/appname/default/master/logback.xml
会给出错误“找不到标签主机”,这是真的,我没有那个标签。通过省略配置文件或标签的任何其他路径组合都会导致 404 一直到调用localhost:8888/logback.xml
. 添加 ?useDefaultLabel 请求参数没有任何区别。实际上,当上下文是获取未绑定到任何特定应用程序、配置文件或标签的纯文本文件时,我不理解 url 的 appname、profile 和 label 部分的用途。
我在互联网上发现了类似的问题,但他们提到更新他们的 Spring Boot 版本,然后它对他们有用。我已经使用了最新的 spring boot 版本(2.1.3-release)。
这是因为我使用SVN吗?还是因为默认标签为空?
解决方案
推荐阅读
- ios - 使用某种持久 id 监视文件
- wordpress - 在 Google Compute Engine 虚拟机上运行的 Wordpress 上通过 SFTP 上传的文件出现 404 错误
- excel - 从 Excel VBA 中的路径获取文件夹名称
- python - Pandas 数据框中的分组箱线图,其中一列是浮点数据,另一列是分类数据
- vue.js - vue fullCalendar 中的 eventClick 具有未定义的道具
- nginx - Kubernetes MetalLB 外部 IP 无法访问
- swift - Swift:如何获得字符的 UTF-8 表示(如 0xXX 0xXX 0xXX ...)?
- python - 在具有匹配值的特定列上加入两个 Pandas DataFrame
- python - 无法在 google colab 中绘制图形
- python - 如何使用 imaplib 和电子邮件为每个 content_type 而不是每个 uid 保存文件