简体   繁体   中英

maven not able to download mysql connector 8.0.12 from central

Maven is not able to download mysql connector 8.0.12 from central, showing the below error:


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.

any help is appreciated, not getting enough suggestion online, trying here.

Solution 1: Try mvn clean install in console.

Solution 2: It might happen because of the firewall on your computer. Turn off the firewall and try it again.

Solution 3: Check if your pom.xml has similar dependency.

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

Use this way in maven :

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

If you are using intelliJ idea there is also an other option:

In the Maven tool window, click The Toggle Offline Mode button.

This will append the --offline option to all Maven commands that IntelliJ IDEA runs. It will also report any items that cannot be found in the local repository.

Or in Maven settings.xml:

<offline>false</offline>

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM