mysql-connector-java: unknown was not found

The IntelliJ cannot find the mysql-connector-java dependency and hits error "unknown was not found"?

pom.xml

  <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <scope>runtime</scope>
  </dependency>
Terminal

mysql:mysql-connector-java:jar:unknown was not found in https://repo.maven.apache.org/maven2
during a previous attempt.

This failure was cached in the local repository and resolution is not reattempted until the
update interval of central has elapsed or updates are forced

Solution

Replace the old MySQL JDBC mysql-connector-java dependency with this mysql-connector-j dependency.

pom.xml

  <dependency>
      <groupId>com.mysql</groupId>
      <artifactId>mysql-connector-j</artifactId>
      <scope>runtime</scope>
  </dependency>

References

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Raavan
2 years ago

Thank you so much! No where I found this solution.