1. 本地启动一个spring cloud 项目,无法启动 (注:测试环境正常),且控台无错误日志。

分析:debug 代码发现是配置无法获取。 查看配置获取方式 是 spring config 通过

spring:
application:
name: cc@project.name.suffix@
profiles:
active: '@profile.name@'
---
spring:
profiles: dev
cloud:
config:
label: dev
discovery:
enabled: true
service-id: xx-config
profile: ${spring.profiles.active}
fail-fast: true

先查看xx-config 服务正常。 说明是项目中无法正确读取配置。

查看上述配置: 如何判断上述配置被程序正常解析了呢?

按住ctrl ,点击 label 进入 

发现 profiles 是 @profile.name@ , 这个是maven 的配置属性。

这个属性是通过 profile =  dev  的 profile 属性。所以在打包的时候  使用 -P dev 打包即可,或者

但是打包启动 ,仍然无法启动。

查看target 下的 打包文件,发现仍然没有正确读取配置。 难道打包出现了问题。

再次maven 打包发现文件正常。 点击启动后,发现偶发文件发生变化,配置属性没有被解析。

百度了一下发现: idea  spring boot 默认build , 而这个build 就是普通编译。 去掉即可。

配置中包含maven属性,在idea中本地启动无法正常获取配置的更多相关文章

  1. 借助JavaScript中的Dom属性改变Html中Table边框的颜色

    借助JavaScript中的Dom属性改变Html中Table边框的颜色 -------------------- <html> <head> <title>我是页 ...

  2. Maven让资源文件处理插件能够解析资源文件中的Maven属性

    <build> <resources> <resource> <directory>${project.basedir}/src/main/resour ...

  3. Eclipse中使用maven构建web项目中遇到的问题

    构建过程参考: http://blog.csdn.net/smilevt/article/details/8215558/ http://www.cnblogs.com/dcba1112/archiv ...

  4. IDEA 中使用Maven Compile 找不到本地 Jar

    本文地址:http://www.cnblogs.com/duwei/p/4656410.html 在IDEA 的子 Maven Module 中使用 compile 进行编译, 一开始提示从私有远程仓 ...

  5. 关于在IJ中使用maven projects 的Lifecycle中打包package报expected START_TAG or END_TAG not TEXT

    报错指定到maven本地仓库下的settings.xml某一行,如下列JDK配置: <profiles> <profile>    <id>jdk-1.8</ ...

  6. java try中包含return语句,finally中的return语句返回顺序

    //结论: finally 中的代码比 return 和 break 语句后执行 public static void main(String[] args) { int x=new Test.tes ...

  7. 关于在IDEA中使用maven projects 的Lifecycle中打包package报expected START_TAG or END_TAG not TEXT

    报错指定到maven本地仓库下的settings.xml某一行,如下列JDK配置: <profiles> <profile>    <id>jdk-1.8</ ...

  8. idea中运行maven安装jar包到本地仓库跳过test

  9. 【Azure 应用服务】App Service For Container 配置Nginx,设置/home/site/wwwroot/目录为启动目录,并配置反向代理

    问题描述 通过Docker Desktop for Linux,配置Nginx镜像后,自定义nginx.conf文件,修改启动目录和对 /out 路径的反向代理到博客园的博文地址 (https://w ...

  10. struts2 笔记01 登录、常用配置参数、Action访问Servlet API 和设置Action中对象的值、命名空间和乱码处理、Action中包含多个方法如何调用

    Struts2登录 1. 需要注意:Struts2需要运行在JRE1.5及以上版本 2. 在web.xml配置文件中,配置StrutsPrepareAndExecuteFilter或FilterDis ...

随机推荐

  1. VUE学习-优化过渡

    过渡(优化) 可复用的过渡 <transition> 或者 <transition-group>为根的组件 Vue.component('my-special-transiti ...

  2. quasar+vue、Input组件绑定两个值

    项目中关于一个只读input绑定两个值,例如input显示取值范围,通过查看vue及quasar文档找出解决方法,如下代码: <q-input v-bind:value="`${det ...

  3. matplotlib 在同一张图中显示两种图例

    L1=plt.legend(['ManyShot','FewShot'],loc='upper left') #保存为L1 plt.legend(['ManyShot','FewShot'],loc= ...

  4. M1芯片使用pod报错 *** for architecture arm64

    1.添加如下配置 pod 和 工程都需要修改 2.Podfile最后添加如下代码 post_install do |installer| installer.pods_project.build_co ...

  5. MariaDB 搭建主备及主主

    一.主备 可参考:MariaDB之GTID主从复制 二.主主

  6. nginx客户端真实IP配置

    https://www.cnblogs.com/kevingrace/p/8269955.html include mime.types; default_type application/octet ...

  7. android studio有关grdle配置

    我们每次新建工程的时候,项目都会通过该路径下寻找适合的gradle包,如果没有则会自动下载到对应的文件夹下

  8. Locust fasthttplocust客户端环境搭建

    1.下载地址:https://github.com/locustio/locust2.python setup.py install3.在执行目录中将安装完成的locust文件夹替换至原本pip下的原 ...

  9. nohup--将程序放入后台执行

    作用:可以将程序以忽略挂起信号的方式运行,常与&一起使用 语法: nohup Command [ Arg - ] [ & ] 将程序放到后台运行的方法: command &  ...

  10. 【uboot 】uboot通过tftp下载内核

    1.开发板uboot,虚拟机能相互ping通 2.ubuntu搭建好tftp服务器,设置好文件夹,放置好文件 sudo apt install tftpd-hpa  //安装服务程序 sudo sys ...