Eclipse m2eclipse在依赖项搜索中找不到任何mysql

发布于 2025-01-02 15:09:41 字数 315 浏览 3 评论 0原文

我正在学习 Maven 并试图找到它经常被告知的自动下载所需 jar 的能力。现在我需要在我的应用程序中访问 Mysql 数据库。因此,我在 pom.xml 可视化编辑器中打开 Dependency 选项卡,然后选择 Add... 按钮。然后我在搜索字符串中输入mysql

Eclipse 什么也没发现。

Mysql JDBC 库不在 Maven(中央?)存储库中,这是真的吗?或者可能是我刚刚配置了错误的东西? Maven 能否在寻找 JDBC 库的任务中发挥自己的作用?

I am learning Maven and trying to find it's often told ability to download required jars automatically. Now I need to access Mysql database in my application. So I opened Dependencies tab in pom.xml visual editor and selected Add... button. Then I entered mysql in the search string.

Eclipse found nothing.

It this true that Mysql JDBC libraries are not on the Maven (central?) repository? Or may be I just configured something incorrectly? Can Maven show itself in the task of looking for JDBC library?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遗心遗梦遗幸福 2025-01-09 15:09:41

Mysql 位于中央 Maven 存储库中。 M2E 使用此存储库。您可以在 Eclipse 的 Maven 存储库视图中查看所有活动存储库(Window > Show View > Other... > Maven > Maven Repositories)。在存储库的上下文菜单中,您可以更新或修复存储库的索引。

Mysql is in the central Maven repo. M2E uses this repo. You can see all active repositories in Eclipse's Maven repository view (Window > Show View > Other... > Maven > Maven Repositories). In the context menu of an repository you can update or repair the repository's index.

宁愿没拥抱 2025-01-09 15:09:41

是的,mysqlconnector 在 Maven 存储库中。

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

您还可以在此处进行检查。

Mysql JDBC 库不在 Maven(中央?)存储库中,这是真的吗?

MySQL JDBC 连接器位于 Maven 存储库中。

或者可能是我配置不正确?

我没有将 Eclipse 与 Maven 一起使用,但您可能想验证 Maven 是否查找您想要的存储库(检查 settings.xml 并检查 Maven 构建日志)。

Yes, mysqlconnector is in the maven repository.

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

You can additionaly check it here.

It this true that Mysql JDBC libraries are not on the Maven (central?) repository?

MySQL JDBC connector is on maven repository.

Or may be I just configured something incorrectly?

I have not used eclipse with maven but you might want to verify that maven looks up repositories you want (check settings.xml and check maven build logs).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文