Skip to content

Commit

Permalink
ci: configure cn.lalaki.central to publish to central portal
Browse files Browse the repository at this point in the history
  • Loading branch information
goatfryed committed Sep 22, 2024
1 parent 5afa9ea commit f46d538
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import cn.lalaki.pub.BaseCentralPortalPlusExtension

plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
id 'signing'
id("cn.lalaki.central") version "1.2.5"
}

group = "io.github.goatfryed"
Expand Down Expand Up @@ -99,7 +101,22 @@ tasks.named('javadoc', Javadoc) {
setFailOnError(true)
}

def centralPortalPublishDummyRepo = new File(projectDir, "build/maven-central-dummy").toURI()
centralPortalPlus {
url = centralPortalPublishDummyRepo
username = findProperty("mavenCentralUsername")
password = findProperty("mavenCentralPassword")
publishingType = BaseCentralPortalPlusExtension.PublishingType.USER_MANAGED
}

publishing {
repositories {
maven {
name = "mavenCentral"
url = centralPortalPublishDummyRepo
}
}

publications {
lib(MavenPublication) {
from components.java
Expand Down Expand Up @@ -137,14 +154,6 @@ publishing {
}
}
}

repositories {
maven {
name = 'mavenCentral'
url = uri('https://central.sonatype.com/api/v1/publisher')
credentials(org.gradle.api.credentials.PasswordCredentials)
}
}
}

signing {
Expand Down

0 comments on commit f46d538

Please sign in to comment.