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
Selenium 如何在Spring Boot中使用较新版本的库_Selenium_Spring Boot_Intellij Idea_Gradle_Maven Bom - Fatal编程技术网

Selenium 如何在Spring Boot中使用较新版本的库

Selenium 如何在Spring Boot中使用较新版本的库,selenium,spring-boot,intellij-idea,gradle,maven-bom,Selenium,Spring Boot,Intellij Idea,Gradle,Maven Bom,我正在使用SpringBoot1.5.9.RELEASE开发一个应用程序,我正在使用Gradle作为构建工具 我想在项目中使用SelenumHQ 3.8.1 在构建项目时,我注意到Selenium 2.53.1被添加到项目中(而不是3.8.1),所以我调查并找出了原因 my build.gradle中存在以下语句: dependencyManagement { imports { mavenBom("org.springframework.boot:spring-boot

我正在使用SpringBoot1.5.9.RELEASE开发一个应用程序,我正在使用Gradle作为构建工具

我想在项目中使用SelenumHQ 3.8.1

在构建项目时,我注意到Selenium 2.53.1被添加到项目中(而不是3.8.1),所以我调查并找出了原因

my build.gradle中存在以下语句:

dependencyManagement {
    imports {
        mavenBom("org.springframework.boot:spring-boot-dependencies:1.5.9.RELEASE")
    }
}
在该文件中,selenium.version属性设置为“2.53.1”

因此,我将声明更改为

dependencyManagement {
    imports {
        mavenBom("org.springframework.boot:spring-boot-dependencies:1.5.9.RELEASE") {
            bomProperty 'selenium.version', '3.8.1'
        }
    }
}
但现在IDEA显示3.8.1和2.53.1都是项目的依赖项,当我使用gradle构建工件时,只有2.53.1依赖项,没有3.8.1的迹象

如何更改此行为并使用Selenium 3.8.1


另外,Selenium由多个jar文件组成,因此它不仅仅是一个jar文件,我希望使用gradle以最最小化的方式更新所有jar文件。

当IntelliJ导入依赖项时,它不会删除像这样的旧依赖项

您必须清除它,然后重新导入依赖项。当然,另一个依赖项也可能依赖于2.53.1,这将使它再次出现


我不知道Gradle,但maven你可以做一个mvn树依赖项,列出所有依赖项,然后再往下看,看看selenium是否也是另一个依赖项的依赖项。

我在中找到了答案


我将使用以下语句覆盖属性:
ext['selenium.version']='3.8.1'
语句。

我已多次删除并读取依赖项,但Idea中仍然存在问题。我建议打印依赖项树并在结果中搜索selenium。在maven中,它是mvn dependency:tree,我建议使用下面发布的链接来获取dependency tree的gradle版本,以查看您是否在其他任何地方对具有不同版本的Selenium具有可传递的依赖关系。下面是StackOverflow中获取gradle中的树的链接。