From ab28f3603cf534ee4393e62bc64d21735598d242 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Thu, 5 Jun 2025 22:25:25 -0400 Subject: [PATCH 1/2] Support publishing to Maven local repository HIBERNATE-90 --- build.gradle.kts | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24187ff1..aea2b3df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,13 +22,22 @@ plugins { id("idea") id("java-library") id("spotless-java-extension") + id("maven-publish") alias(libs.plugins.errorprone) alias(libs.plugins.buildconfig) } repositories { mavenCentral() } -java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } +java { + toolchain { languageVersion = JavaLanguageVersion.of(17) } + withJavadocJar() + withSourcesJar() +} + +tasks.withType { + exclude("/com/mongodb/hibernate/internal/**") +} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Integration Test @@ -150,3 +159,35 @@ dependencies { implementation(libs.mongo.java.driver.sync) implementation(libs.sl4j.api) } + +publishing { + publications { + create("mavenJava") { + groupId = "org.mongodb" + artifactId = "mongodb-hibernate" + from(components["java"]) + pom { + name = "MongoDB Hibernate Dialect" + description = "A MongoDB Dialect for the Hibernate ORM" + url = "https://www.mongodb.com/" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + developers { + developer { + name.set("Various") + organization.set("MongoDB") + } + } + scm { + url.set("https://github.com/mongodb/mongo-hibernate") + connection.set("scm:https://github.com/mongodb/mongo-hibernate.git") + developerConnection.set("scm:https://github.com/mongodb/mongo-hibernate.git") + } + } + } + } +} From 43cc5c2a5d536f68b824a79cccd6ff39bf2afb68 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Fri, 6 Jun 2025 11:55:03 -0400 Subject: [PATCH 2/2] Update name and description. --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index aea2b3df..f5c12545 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -167,8 +167,8 @@ publishing { artifactId = "mongodb-hibernate" from(components["java"]) pom { - name = "MongoDB Hibernate Dialect" - description = "A MongoDB Dialect for the Hibernate ORM" + name = "MongoDB Hibernate Extension" + description = "A MongoDB Extension of Hibernate ORM" url = "https://www.mongodb.com/" licenses { license {