Wal*_*ker 7 java junit android intellij-idea gradle
我正在使用 IntelliJ 来同步 Gradle。Gradle项目是由IntelliJ模板提供的,但错误仍然存在。
我尝试过:
我的系统:MacOS Big Sur
所以这是错误:
FAILURE: Build failed with an exception.
* What went wrong:
Could not download junit-jupiter-api-5.7.0.jar (org.junit.jupiter:junit-jupiter-api:5.7.0)
Could not get resource 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar'.
Could not GET 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar'.
The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.1/userguide/build_environment.html#gradle_system_properties
Remote host closed connection during handshake
SSL peer shut down incorrectly
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not download junit-jupiter-api-5.7.0.jar (org.junit.jupiter:junit-jupiter-api:5.7.0)
Could not get resource 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar'.
Could not GET 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar'.
The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.1/userguide/build_environment.html#gradle_system_properties
Remote host closed connection during handshake
SSL peer shut down incorrectly
at org.jetbrains.plugins.gradle.model.ProjectImportAction.addBuildModels(ProjectImportAction.java:346)
at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:127)
...[omitted numerous lines]
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar'
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar'.
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used.
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:505)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:990)
Run Code Online (Sandbox Code Playgroud)
这是我的 gradle 构建脚本:
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
test {
useJUnitPlatform()
}
Run Code Online (Sandbox Code Playgroud)
非常感谢!!!!!!!
小智 3
这是因为 Maven Central 和 Bintray 已宣布将停止对 TLS v1.1 及更低版本的支持
将 mavenCentral() 替换为 maven { url = "http://repo.maven.apache.org/maven2" } 并将 jcenter() 替换为 maven { url = "http://jcenter.bintray.com" }
欲了解更多信息:https ://blog.gradle.org/unable-to-download-maven-central-bintray
| 归档时间: |
|
| 查看次数: |
10879 次 |
| 最近记录: |