【问题标题】:Missing artifact org.hibernate:hibernate-core缺少工件 org.hibernate:hibernate-core
【发布时间】:2018-10-27 03:20:00
【问题描述】:

我正在使用 Maven。我无法下载依赖项并收到错误消息“缺少工件 org.hibernate:hibernate-core:jar:5.2.10.final”。 我从 git 中删除了整个项目并再次克隆它。我更新了 maven 依赖项,但其中仍然没有休眠文件加载。 这是我的 pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>gau</groupId>
<artifactId>shoppingbackend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>shoppingbackend</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>4.3.6.RELEASE</spring.version>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>

    <!-- SPRING -->
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <!-- H2 Database -->
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.4.193</version>
    </dependency>


    <!-- Hibernate -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.2.10.Final</version>
    </dependency>


    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
        <version>1.0.1.Final</version>
    </dependency>

    <!-- Database connection pooling -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-dbcp2</artifactId>
        <version>2.1.1</version>
    </dependency>

</dependencies>
<build>
    <plugins>
        <plugin>
            <!-- update to latest java version -->
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

我的项目的 Git 链接

https://github.com/Gauravmokashi/online-shopping.git

【问题讨论】:

  • 好像hibernate-jpa-2.0-api 依赖引用了旧的Hibernate 4.x
  • @LuiggiMendoza 即使在删除 hibernate-jpa-2.0-api 并更新 maven 后也没有变化
  • 好的,你能检查一下你的 maven 存储库文件夹中是否有 hibernate-core 5.2.10.Final 的 jar 吗?也许那里有一个损坏的罐子。
  • hibernate-core 5.2.10.Final 没有jar,即使更新了maven,也无法下载这个特定的jar。

标签: java hibernate maven


【解决方案1】:

您可以检查您的任何其他 Maven 项目当前是否正在为 Hibernate 使用此依赖项,如果有,则停用它们。之后,将此依赖项放入您需要的项目的 pom.xml 文件中并更新所有 Maven 项目。那么它应该可以工作了。

【讨论】:

    猜你喜欢
    • 2019-07-11
    • 1970-01-01
    • 2012-01-12
    • 2012-02-18
    • 2014-01-04
    • 2013-07-12
    • 1970-01-01
    • 2015-05-08
    • 1970-01-01
    相关资源
    最近更新 更多