2016-08-03 58 views
1

讓A成爲我的核心jar maven項目類。而W是我在另一個項目中的戰爭。我已經添加了A作爲我對W.的依賴項。我在資源文件夾中將我的prop.properties文件存儲在A中。如何在我的戰爭中使用類路徑從jar中訪問屬性文件。使用Spring 4 我已經更新spring.xml與罐子下面:通過類路徑在war tomcat中的依賴jar中訪問屬性文件Spring

<context:property-placeholder 
location="classpath:prop.properties" ignore-unresolvable="true"/> 

回答

7

使用Asteriskclasspath在此之後會告訴春天來尋找配置所有添加的依賴在類路徑:

<context:property-placeholder 
location="classpath*:prop.properties" ignore-unresolvable="true"/> 
+0

感謝您的答案...它的工作原理:-)會點擊+2 .... –

相關問題