Search code examples
hibernatemavenconfiguration

Missing hibernate ORM snapshot in pom.xml


I'm trying to test Hibernate ORM snapshot 7.0.0 but I'm getting an error while trying to add it as a dependency in pom.xml:

Missing artifact org.hibernate.orm:hibernate-core:jar:7.0.0-SNAPSHOT

What am I doing wrong?

URL for repository is given on Hibernate website: here

pom.xml

<properties>
    <hibernate-core.version>7.0.0-SNAPSHOT</hibernate-core.version>
</properties>

<repositories>
    <repository>
        <id>hibernate-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots/org/hibernate/orm/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.hibernate.orm</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate-core.version}</version>
    </dependency>
</dependencies>

Also tried this one from other StackOverflow answer but the result is the same:

<profiles>
    <profile>
        <id>allow-snapshots</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>snapshots-repo</id>
                <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>


Solution

  • The only thing what was wrong is a direcory:

    WRONG directory: https://oss.sonatype.org/content/repositories/snapshots/org/hibernate/orm/

    CORRECT directory: https://oss.sonatype.org/content/repositories/snapshots

    <repositories>
       <repository>
           <id>hibernate-snapshots</id>
           <name>Hibernate snapshots</name>
           <url>https://oss.sonatype.org/content/repositories/snapshots</url>
       </repository>
    </repositories>