Java Spring引导无法使用依赖的application.properties

Java Spring引导无法使用依赖的application.properties,java,spring-boot,spring-boot-actuator,maven-resources-plugin,spring-boot-starter,Java,Spring Boot,Spring Boot Actuator,Maven Resources Plugin,Spring Boot Starter,我正在使用Spring Boot 2.2.9.0版本。我有主应用程序和一些普通启动程序(只使用弹簧执行器功能),其部分启动程序/src/main/resources/application中有一些属性。属性文件: management.server.port=9000 management.server.ssl.enabled=false management.endpoints.enabled-by-default=false management.endpoint.health.enable

我正在使用Spring Boot 2.2.9.0版本。我有主应用程序和一些普通启动程序(只使用
弹簧执行器
功能),其
部分启动程序/src/main/resources/application中有一些属性。属性
文件:

management.server.port=9000
management.server.ssl.enabled=false
management.endpoints.enabled-by-default=false
management.endpoint.health.enabled=true
management.endpoints.web.base-path=/
management.endpoints.web.path-mapping.health=health
我已经将starter导入了我的主应用程序,我认为healthcheck端点应该与端口
9000
和路径
/health
(smth类似
localhost:9000/health

但事实并非如此。但是,如果我的主应用程序
main-app/src/main/resources/application.properties中的属性相同,它就可以工作


Spring引导中的属性重写有问题吗?当从类路径加载
application.properties
时,是否应该通过类似
maven resources plugin
的方式配置资源?

将忽略类路径上的任何其他内容。在您的情况下,
main app/src/main/resources/application.properties
中的文件将出现在
application.properties
的jar中
application.properties
之前的类路径上


顾名思义,
application.properties
用于配置应用程序,不应在初学者中使用。您应该配置应用程序中的所有属性,或者您可以更新starter,使其包含通过
spring.Factorys
注册的
环境后处理器
,并将一些默认属性添加到
环境

非常感谢您的回答!我要检查
环境后处理器
。然而,如果我想在没有任何附加代码的情况下向我的初学者/库添加一些属性,该怎么办。我应该为属性文件使用另一个名称,还是可以合并主属性和第三方属性?