How to add a snapshot dependency for Hibernate 7?

I spent a whole day trying to add a snapshot dependency to my project to give Hibernate 7 a try and prepare to upgrade when it goes to RC. But no success at all.

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

Tried to put 6.5.0-SNAPSHOT instead of 7.0.0-SNAPSHOT, but the result is the same - missing dependecy.

Starting point was an article on Hibernate website: Hibernate ORM 6.5 series (development)

What am I doing wrong?

The question at StackOverflow if anyone wants to get points with correct answer: StackOverflow


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>

The first version of your pom.xml is almost correct, you should just add the root repository and not the “/org/hibernate/orm/” subdirectory:

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

Well… stupid me.
Thank you for “almost correct” - it was polite. <3