Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何在多模块项目中仅设置一个ehcache.xml?_Spring Boot_Ehcache_Spring Cache_Jcache - Fatal编程技术网

Spring boot 如何在多模块项目中仅设置一个ehcache.xml?

Spring boot 如何在多模块项目中仅设置一个ehcache.xml?,spring-boot,ehcache,spring-cache,jcache,Spring Boot,Ehcache,Spring Cache,Jcache,我有一个“公共”项目,我想在其中放置ehcache.xml。 然后,我有一系列spring启动项目,使用EnableCaching注释,如下所示: @EnableCaching public class Project1SpringBoot { .... .... 在应用程序属性的内部,我有: spring.cache.jcache.config: classpath:ehcache.xml 但是我想指出“公共”项目类路径,因此我不必在n个项目上复制ehcache.xml

我有一个“公共”项目,我想在其中放置ehcache.xml。 然后,我有一系列spring启动项目,使用EnableCaching注释,如下所示:

@EnableCaching
public class Project1SpringBoot {
     ....
     ....
在应用程序属性的内部,我有:

spring.cache.jcache.config: classpath:ehcache.xml
但是我想指出“公共”项目类路径,因此我不必在n个项目上复制ehcache.xml文件


可能吗?或者你能给我一个不同的建议吗?

你说的应该有用。如果公共项目包含
ehcache.xml
文件,并且公共项目位于类路径或其他项目中,那么
classpath:ehcache.xml
应该可以工作