【发布时间】:2022-01-20 18:01:09
【问题描述】:
我已将以下内容添加到我的应用程序build.gradle 的dependencies 部分中
implementation 'org.seleniumhq.selenium:selenium-htmlunit-driver:3.56.0'
但我得到了错误:
Could not find org.seleniumhq.selenium:selenium-htmlunit-driver:3.56.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/seleniumhq/selenium/selenium-htmlunit-driver/3.56.0/selenium-htmlunit-driver-3.56.0.pom
- https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-htmlunit-driver/3.56.0/selenium-htmlunit-driver-3.56.0.pom
- https://jcenter.bintray.com/org/seleniumhq/selenium/selenium-htmlunit-driver/3.56.0/selenium-htmlunit-driver-3.56.0.pom
Required by:
project :app
所以在项目build.gradle文件中,我添加到repositories部分:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
// ADDED THIS 2021 12 17
maven {
url("https://mvnrepository.com")
}
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
}
}
我认为这会起作用,因为当我使用浏览器导航时,有一个带有selenium-htmlunit_driver_3.56.0 的页面,域mvnrepository.com。
我所期望的是会找到指定的依赖项。或者,我会得到一份报告,其中将在“在以下位置搜索:”下包含另一行,但将该行添加到项目 build.grade 中无效。
我需要做什么才能搜索到额外的 Maven 存储库?从 mavenCentral() 条目 (repo.maven.apache.org/maven2...) 中提取的 maven 存储库不包含我想尝试的 selenium-htmlunit-drive 版本。
这是使用 Artic Fox 2020.3.1 补丁 3。
我做错了什么?
【问题讨论】:
标签: android-studio maven build dependencies