java - 无法添加maven依赖

标签 java hibernate maven jakarta-ee pom.xml

当我右键单击项目时,然后单击 Maven,然后单击添加依赖项。 它显示错误。 Artifact ID 不能为空。 我重建了索引。 我不知道在 Artifact ID 和组 ID 中放入什么。 我想添加 Hibernate 库。

最佳答案

将其放入 pom.xml依赖项部分:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.3.6.Final</version>
</dependency>

来自Maven documentation :

The minimum requirement for a POM are the following:

  • project root
  • modelVersion - should be set to 4.0.0
  • groupId - the id of the project's group.
  • artifactId - the id of the artifact (project)
  • version - the version of the artifact under the specified group

关于java - 无法添加maven依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26383157/

相关文章:

java - 如何使用maven shade插件向jar添加资源

java - 如何将多个 &lt;input type =“checkbox”/> 作为数组发送到 Java servlet?

java - 如何在 IntelliJ IDEA 中创建 JavaFX Maven 项目?

java - Spring data jpa 标准如下

java - Spring mvc 映射问题

java - 从 Maven 项目的类路径中排除某些依赖项

file - 如何在命令行中为 maven 发布插件设置排除列表?

java - Android 上的 Google Collection

java - 字符串文字内存利用率

java - 当我们按 id 过滤列表时,如何使用 HQL 一对多查询关系