我的应用对com.google.guava:guava:23.3
或更高版本有严格的依赖性
+--- com.github.ben-manes.caffeine:guava:2.6.0
| +--- com.github.ben-manes.caffeine:caffeine:2.6.0
| \--- com.google.guava:guava:23.3-jre (*)
但是我也在使用
org.seleniumhq.selenium:selenium-java:3.0.1
,它与guava版本> 22.0不兼容,如下所述:https://github.com/SeleniumHQ/selenium/issues/4381
我对Java很陌生,这里最好的做法是什么?
我已经研究过类装载机,但看起来像是一个很深的兔子洞。
最佳答案
由于您对,com.google.guava:guava:23.3
,的依赖性很强,因此可能会遇到麻烦。但是Selenium发行说明清楚地提到了以下 Guava 相关性:
org.seleniumhq.selenium:selenium-java:3.0.1
:将 Guava 凸版到版本19 Selenium v2.49.0
:需要更新到最新的 Guava 21.0版Selenium v3.1.0
:将 Guava 充气到版本22。Selenium v3.5.0
:将 Guava 充气到版本23。Selenium v3.5.1
: Guava 23.6-jre Selenium v3.12.0
: Guava 25.0-jre Selenium v3.13.0
: Guava 25.0-jre Selenium v3.14.0
: Guava 25.0-jre Selenium v3.141.0
: Guava 25.0-jre Selenium v3.141.5
: Guava 25.0-jre 结论
因此,
Selenium v3.141.59
得到了 Guava 23.6-jre ,显然符合您的要求。