77 */
88
99plugins {
10- // Apply the java-library plugin to add support for Java Library
1110 id ' java-library'
1211 id ' maven-publish'
1312 id ' signing'
13+ id ' org.danilopianini.publish-on-central' version " 8.0.7"
1414 id ' jacoco'
15- id ' io.github.gradle-nexus.publish-plugin' version " 2.0.0"
1615 id " com.diffplug.spotless" version " 6.13.0"
1716}
1817
@@ -23,6 +22,8 @@ version = '0.14.5'
2322java {
2423 sourceCompatibility = JavaVersion . VERSION_1_8
2524 targetCompatibility = JavaVersion . VERSION_1_8
25+ withJavadocJar()
26+ withSourcesJar()
2627}
2728
2829jacoco {
@@ -44,10 +45,6 @@ repositories {
4445 mavenCentral()
4546}
4647
47- configurations {
48- testCompile. extendsFrom compileOnly
49- }
50-
5148dependencies {
5249 // This dependency is used internally, and not exposed to consumers on their own compile classpath.
5350 implementation ' com.google.code.gson:gson:2.12.1'
@@ -78,19 +75,6 @@ dependencies {
7875 implementation ' com.auth0:java-jwt:4.5.0'
7976}
8077
81- task buildJar (type : Jar ) {
82- archiveBaseName = ' meilisearch-java'
83- from {
84- configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) }
85- }
86- {
87- exclude ' META-INF/*.SF'
88- exclude ' META-INF/*.DSA'
89- exclude ' META-INF/*.RSA'
90- }
91- with jar
92- }
93-
9478test {
9579 finalizedBy jacocoTestReport
9680 useJUnitPlatform {
@@ -122,70 +106,18 @@ task integrationTest(type: Test) {
122106 }
123107}
124108
125- java {
126- withJavadocJar()
127- withSourcesJar()
128- }
129-
130- publishing {
131- publications {
132- mavenJava(MavenPublication ) {
133- artifactId = ' meilisearch-java'
134- from components. java
135- pom {
136- name = ' com.meilisearch.sdk:meilisearch-java'
137- packaging = ' jar'
138- artifactId = ' meilisearch-java'
139- description = ' Meilisearch is a powerful, fast, open-source, easy to use and deploy search engine.'
140- url = ' https://github.com/meilisearch/meilisearch-java'
141- scm {
142- connection = ' scm:git:git://github.com/meilisearch/meilisearch-java.git'
143- developerConnection = ' scm:git:ssh://github.com:meilisearch/meilisearch-java.git'
144- url = ' http://github.com/meilisearch/meilisearch-java'
145- }
146- licenses {
147- license {
148- name = ' MIT License'
149- url = ' http://www.opensource.org/licenses/mit-license.php'
150- }
151- }
152- developers {
153- developer {
154- id = ' eskombro'
155- name = ' Samuel Jimenez'
156- 157- }
158- }
159- }
160- }
161- }
162- repositories {
163- maven {
164- url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
165- credentials {
166- username System . getenv(' OSSRH_USERNAME' )
167- password System . getenv(' OSSRH_PASSWORD' )
168- }
169- }
170- }
171- }
172-
173- nexusPublishing {
174- packageGroup = " com.meilisearch"
175-
176- repositories {
177- sonatype {
178- nexusUrl. set(uri(" https://oss.sonatype.org/service/local/" ))
179-
180- username = System . getenv(' OSSRH_USERNAME' )
181- password = System . getenv(' OSSRH_PASSWORD' )
182- stagingProfileId = System . getenv(' SONATYPE_STAGING_PROFILE_ID' )
183- }
184- }
109+ // New Maven Central Portal publishing configuration
110+ publishOnCentral {
111+ repoOwner. set(" meilisearch" )
112+ projectDescription. set(" Meilisearch Java SDK" )
113+ projectUrl. set(" https://github.com/meilisearch/meilisearch-java" )
185114}
186115
187116signing {
188- sign publishing. publications. mavenJava
117+ useInMemoryPgpKeys(
118+ findProperty(" signingKey" )?. toString(),
119+ findProperty(" signingPassword" )?. toString()
120+ )
189121}
190122
191123javadoc {
0 commit comments