在项目中引入spring boot, 整个项目分成几个子项目, 其中几个子项目构建成普通的jar包, 不是自执行的jar包TopProject-->a.jar这时a只能获取到最顶层的application.properties, 有什么办法可以获取到a.jar包内的application.properties
学习是最好的投资!
For this TopProject, a.jar is a package, and by design it should not be able to read application.properties inside the a.jar package.
application.properties
The correct approach is to read it from the class in the a.jar package, and then expose the function for TopProject to call.
It’s very simple, use classpath*:application.properties to get the configuration in the jar
For this TopProject, a.jar is a package, and by design it should not be able to read
application.properties
inside the a.jar package.The correct approach is to read it from the class in the a.jar package, and then expose the function for TopProject to call.
It’s very simple, use classpath*:application.properties to get the configuration in the jar