【问题标题】:Why is EhCache still being downloaded and initialized in my project为什么我的项目中仍在下载和初始化 EhCache
【发布时间】:2019-03-22 13:18:09
【问题描述】:

我有一个 grails 3 项目,我目前正在替换 EhCache 实现,以使用由 AWS 和 Redisson 托管的 Redis 缓存服务器进行客户端连接。我已经完全删除了对 EhCache 的所有引用以及 gradle 文件中的依赖项声明,甚至删除了 net.sf.EhCache 中引用 EhCache 的 .gradle 文件夹以及默认将其添加到项目中的故障安全 XML 文件。

我不明白为什么我不能摆脱这个缓存实现,并阻止它再次将其拉入/拉出 repo 并在构建和运行过程中对其进行初始化。同样,源代码中也没有声明这个 ANYWHERE。 下面是一些日志来描述我所看到的。

2018-10-16 16:56:18,324 WARN | | localhost-startStop-1 | | | n.s.e.c.ConfigurationFactory | No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:.../net.sf.ehcache/ehcache/2.10.3/.../ehcache-2.10.3.jar!/ehcache-failsafe.xml

2018-10-16 14:25:47,442 INFO     |  | localhost-startStop-1 |  |  | o.s.c.e.EhCacheManagerFactoryBean | Initializing EhCache CacheManager

【问题讨论】:

  • 肯定是传递依赖。您的其他依赖项之一是将其拉入。
  • @BrentR 我是否只需要挖掘我所有的外部依赖项/库来寻找它?

标签: java caching grails redis ehcache


【解决方案1】:

official docs之后:

dependency-report 命令生成显示 JAR 的 Ivy 报告 应用程序所需的依赖项。

grails dependency-report runtime

【讨论】:

  • 我发现它实际上是 @BrentR 所建议的 Springframework.spring-context-support 的传递依赖。现在我正在研究如何从 gradle 构建中排除这种依赖关系。如果您有知道的可以分享的链接,我将不胜感激。
  • 非常感谢。这让我到达了我想去的地方
猜你喜欢
  • 2012-08-09
  • 2012-06-17
  • 2018-05-29
  • 2012-05-17
  • 2010-12-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多