通过classpath Spring访问war tomcat中依赖关系jar中的属性文件

Mal*_*mar 1 java spring tomcat maven

设A是我的核心jar maven为基础的项目类.在另一个项目中,W是我的战争.我已经添加了A作为我对W的依赖.我已将prop.properties文件存储在资源文件夹中的A中.如何在战争中使用类路径从jar访问属性文件.使用Spring 4.我已经使用以下内容更新了jar的spring.xml:

 <context:property-placeholder 
 location="classpath:prop.properties" ignore-unresolvable="true"/>
Run Code Online (Sandbox Code Playgroud)

Raf*_*LDI 8

在此之后使用Asteriskclasspath将告诉spring在类路径中的所有添加的依赖项中查找配置:

<context:property-placeholder 
 location="classpath*:prop.properties" ignore-unresolvable="true"/>
Run Code Online (Sandbox Code Playgroud)