@@ -3,65 +3,52 @@ import org.gradle.api.publish.maven.MavenPublication
3
3
import org.gradle.kotlin.dsl.configure
4
4
import org.gradle.kotlin.dsl.register
5
5
import org.gradle.kotlin.dsl.get
6
+ import com.vanniktech.maven.publish.JavaLibrary
7
+ import com.vanniktech.maven.publish.JavadocJar
8
+ import com.vanniktech.maven.publish.MavenPublishBaseExtension
9
+ import com.vanniktech.maven.publish.SonatypeHost
6
10
7
11
plugins {
8
- `maven- publish`
9
- `signing`
12
+ id(" com.vanniktech.maven.publish" )
10
13
}
11
14
12
- configure< PublishingExtension > {
13
- publications {
14
- register< MavenPublication >( " maven " ) {
15
- from(components[ " java " ])
15
+ repositories {
16
+ gradlePluginPortal()
17
+ mavenCentral()
18
+ }
16
19
17
- pom {
18
- name.set(" Openlayer API" )
19
- description.set(" API for interacting with the Openlayer server." )
20
- url.set(" https://openlayer.com/docs/api-reference/rest/overview" )
20
+ extra[" signingInMemoryKey" ] = System .getenv(" GPG_SIGNING_KEY" )
21
+ extra[" signingInMemoryKeyId" ] = System .getenv(" GPG_SIGNING_KEY_ID" )
22
+ extra[" signingInMemoryKeyPassword" ] = System .getenv(" GPG_SIGNING_PASSWORD" )
21
23
22
- licenses {
23
- license {
24
- name.set(" Apache-2.0" )
25
- }
26
- }
24
+ configure<MavenPublishBaseExtension > {
25
+ signAllPublications()
26
+ publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL )
27
27
28
- developers {
29
- developer {
30
- name.set(" Openlayer" )
31
-
32
- }
33
- }
28
+ this .coordinates(project.group.toString(), project.name, project.version.toString())
34
29
35
- scm {
36
- connection.set(" scm:git:git://github.com/openlayer-ai/openlayer-java.git" )
37
- developerConnection.set(" scm:git:git://github.com/openlayer-ai/openlayer-java.git" )
38
- url.set(" https://github.com/openlayer-ai/openlayer-java" )
39
- }
30
+ pom {
31
+ name.set(" Openlayer API" )
32
+ description.set(" API for interacting with the Openlayer server." )
33
+ url.set(" https://openlayer.com/docs/api-reference/rest/overview" )
40
34
41
- versionMapping {
42
- allVariants {
43
- fromResolutionResult()
44
- }
45
- }
35
+ licenses {
36
+ license {
37
+ name.set(" Apache-2.0" )
46
38
}
47
39
}
48
- }
49
- }
50
40
51
- signing {
52
- val signingKeyId = System .getenv(" GPG_SIGNING_KEY_ID" )?.ifBlank { null }
53
- val signingKey = System .getenv(" GPG_SIGNING_KEY" )?.ifBlank { null }
54
- val signingPassword = System .getenv(" GPG_SIGNING_PASSWORD" )?.ifBlank { null }
55
- if (signingKey != null && signingPassword != null ) {
56
- useInMemoryPgpKeys(
57
- signingKeyId,
58
- signingKey,
59
- signingPassword,
60
- )
61
- sign(publishing.publications[" maven" ])
62
- }
63
- }
41
+ developers {
42
+ developer {
43
+ name.set(" Openlayer" )
44
+
45
+ }
46
+ }
64
47
65
- tasks.named(" publish" ) {
66
- dependsOn(" :closeAndReleaseSonatypeStagingRepository" )
48
+ scm {
49
+ connection.set(" scm:git:git://github.com/openlayer-ai/openlayer-java.git" )
50
+ developerConnection.set(" scm:git:git://github.com/openlayer-ai/openlayer-java.git" )
51
+ url.set(" https://github.com/openlayer-ai/openlayer-java" )
52
+ }
53
+ }
67
54
}
0 commit comments