maven无法从central下载mysql connector 8.0.12

klr1opcd  于 2021-06-20  发布在  Mysql
关注(0)|答案(2)|浏览(618)

maven无法从central下载mysql connector 8.0.12,出现以下错误:

Downloading: https://repo.maven.apache.org/maven2/mysql/mysql-connector- 
java/8.0.12/mysql-connector-java-8.0.12.pom
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 3.642 s
[INFO] Finished at: 2018-08-21T00:22:03+05:30
[INFO] Final Memory: 10M/113M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal on project OneSolution: Could not resolve 
dependencies for project OneSolution:OneSolution:jar:1.1.1: Failed to 
collect dependencies at mysql:mysql-connector-java:jar:8.0.12: Failed to 
read artifact descriptor for mysql:mysql-connector-java:jar:8.0.12: Could 
not transfer artifact mysql:mysql-connector-java:pom:8.0.12 from/to central 
(https://repo.maven.apache.org/maven2): Received fatal alert: 
protocol_version -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

任何帮助是感激的,没有得到足够的建议网上,尝试在这里。

1qczuiv0

1qczuiv01#

在maven中使用这种方式:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.12</version> 
</dependency>
hrysbysz

hrysbysz2#

Solution 1: 尝试 mvn clean install 在控制台中。 Solution 2: 这可能是因为你电脑上的防火墙。关闭防火墙并重试。  Solution 3: 检查您的 pom.xml 有相似的依赖关系。

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.12</version>
</dependency>

相关问题