Skip to content

Commit defcbb7

Browse files
committed
WIP #5
1 parent 0255d83 commit defcbb7

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

build.gradle.kts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,25 @@ val pomAction = object : Action<MavenPom> {
9898
}
9999
}
100100

101+
// ----------------------
102+
// PUBLISHING TO SONATYPE
103+
// ----------------------
104+
// eu.kakde.gradle.sonatype-maven-central-publisher
105+
sonatypeCentralPublishExtension {
106+
// Set group ID, artifact ID, version, and other publication details
107+
groupId.set(project.group.toString())
108+
artifactId.set(project.name)
109+
version.set(project.version.toString())
110+
componentType.set("java") // "java" or "versionCatalog"
111+
publishingType.set("USER_MANAGED") // USER_MANAGED or AUTOMATIC
112+
113+
// Set username and password for Sonatype repository
114+
username.set(System.getenv("SONATYPE_USERNAME") ?: project.properties["sonatypeUsername"].toString())
115+
password.set(System.getenv("SONATYPE_PASSWORD") ?: project.properties["sonatypePassword"].toString())
116+
117+
pom(pomAction)
118+
}
119+
101120
// github packages
102121
publishing {
103122
repositories {
@@ -112,32 +131,13 @@ publishing {
112131

113132
}
114133

115-
publications {
134+
/*publications {
116135
register("jar", MavenPublication::class) {
117136
from(components["java"])
118137
//artifact(tasks.named("sourcesJar"))
119138
//artifact(tasks.named("javadocJar"))
120139
pom(pomAction)
121140
}
122-
}
141+
}*/
123142

124143
}
125-
126-
// ----------------------
127-
// PUBLISHING TO SONATYPE
128-
// ----------------------
129-
// eu.kakde.gradle.sonatype-maven-central-publisher
130-
sonatypeCentralPublishExtension {
131-
// Set group ID, artifact ID, version, and other publication details
132-
groupId.set(project.group.toString())
133-
artifactId.set(project.name)
134-
version.set(project.version.toString())
135-
componentType.set("java") // "java" or "versionCatalog"
136-
publishingType.set("USER_MANAGED") // USER_MANAGED or AUTOMATIC
137-
138-
// Set username and password for Sonatype repository
139-
username.set(System.getenv("SONATYPE_USERNAME") ?: project.properties["sonatypeUsername"].toString())
140-
password.set(System.getenv("SONATYPE_PASSWORD") ?: project.properties["sonatypePassword"].toString())
141-
142-
pom(pomAction)
143-
}

0 commit comments

Comments
 (0)