[英]coordination versions of related libs when i add new lib in project
There is one lib for selenium org.seleniumhq.selenium: selenium-java : 2.53.1 硒org.seleniumhq.selenium有一个库: selenium-java : 2.53.1
org.seleniumhq.selenium: selenium-server : 2.44.0 org.seleniumhq.selenium: selenium-server : 2.44.0
Now I need to add selenium server dependency for my new tasks in this project, but within adding selenium server dependency I meet problem that there are not some classes(as example ' java.lang.NoClassDefFoundError: org/openqa/selenium/ImmutableCapabilities '), therefore I find in maven central modules that contains this classes and include them in project, but this modules has transitive dependencies that already exists in project(and have another versions) 现在,我需要为该项目中的新任务添加硒服务器依赖关系,但是在添加硒服务器依赖关系时,我遇到了没有某些类的问题(例如' java.lang.NoClassDefFoundError:org / openqa / selenium / ImmutableCapabilities ') ,因此我在maven中央模块中找到了包含此类的类并将其包含在项目中,但是此模块具有在项目中已经存在的可传递依赖项(并具有其他版本)
key point is that transitive modules has not classes that I use in my first task related with selenium 关键是传递模块没有我在与硒相关的第一个任务中使用的类
How I may find true version for selenium server lib(and his transitive dependencies) that i could not try all combinations of libs versions 我如何才能找到无法尝试所有libs版本组合的硒服务器lib(及其传递依赖项)的真实版本
May be in gradle exist such function or exist separate tool or service for this 可能存在此功能或为此存在单独的工具或服务
Add below dependency into Maven pom.xml
as following: 将以下依赖项添加到Maven
pom.xml
,如下所示:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
you can change the version 3.11.0
to other, Maven will download all transitive dependencies for you. 您可以将版本
3.11.0
更改为其他版本,Maven将为您下载所有传递依赖。
You wanted class ImmutableCapabilities
is neither in selenium-java.jar
nor selenium-sever.jar
. 您想要的类
ImmutableCapabilities
既不在selenium-java.jar
也不在selenium-sever.jar
。 But in selenium-api.jar
as following: 但是在
selenium-api.jar
,如下所示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.