简体   繁体   English

我在项目中添加新库时相关库的协调版本

[英]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-java2.53.1

org.seleniumhq.selenium: selenium-server : 2.44.0 org.seleniumhq.selenium: selenium-server2.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.

相关问题 Android开发中的新手; 如何将Java库添加到Android Studio项目? - Very new at Android development; how do I add a Java lib to Android Studio project? 当我添加库时,Android Studio应用程序不想编译 - Android studio app does not want compile when I add libs 当我从 Maven 向项目添加 lib 时。 如何找出我可以使用的课程? - When I add a lib to a project from maven. How do I find out classes I can use? 有没有一种方法可以在Eclipse中将“ libs”文件夹添加到我的项目中 - Is there a way to add a 'libs' folder to my project in Eclipse 如何在jar中导出项目的库? - How can I export the libs of a project in the jar? 当我引用一些jre库时,如何使用ant构建android项目 - How to build android project using ant, when i referenced some jre libs 当我添加Apache POI库时,获取“:app:mergeDebugResources FAILED” - Getting “:app:mergeDebugResources FAILED” when I add Apache POI lib IntelliJ Idea Ultimate在创建新的Spring项目时下载旧版本的Spring文件 - IntelliJ Idea Ultimate downloads old versions of Spring files when Creating new Spring Project 在Eclipse中,我没有在添加新项目向导中添加“插件” - In Eclipse, I do not have add 'plugin' in the add new project wizard 如何将OpenCV库添加到动态Web项目 - How to add OpenCV lib to Dynamic Web Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM