java - spring boot构建普通jar包, 被其他jar包依赖, 如果读取jar包中application.properties
PHPz
PHPz 2017-04-18 09:13:08
0
2
392

在项目中引入spring boot, 整个项目分成几个子项目, 其中几个子项目构建成普通的jar包, 不是自执行的jar包
TopProject-->a.jar
这时a只能获取到最顶层的application.properties, 有什么办法可以获取到a.jar包内的application.properties

PHPz
PHPz

学习是最好的投资!

reply all(2)
刘奇

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.

Peter_Zhu

It’s very simple, use classpath*:application.properties to get the configuration in the jar

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template