Skip to content

Commit

Permalink
发布中央仓库调整(不再支持SNAPSHOT发布).
Browse files Browse the repository at this point in the history
  • Loading branch information
nieqiurong committed Aug 8, 2024
1 parent 42c4acc commit cd4c856
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
22 changes: 13 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ subprojects {
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'tech.yanand.maven-central-publish'
apply plugin: "io.freefair.lombok"

sourceCompatibility = "${javaVersion}"
Expand Down Expand Up @@ -187,17 +188,20 @@ subprojects {
publishing {
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

credentials {
username System.getenv("MAVEN_USERNAME")
password System.getenv("MAVEN_PASSWORD")
}
name = "Local"
url = layout.buildDirectory.dir('repos/bundles')
}
}

// use example : ./gradlew clean build publish publishToMavenCentralPortal -DauthToken='xxxxxx' -x test
mavenCentral {
repoDir = layout.buildDirectory.dir('repos/bundles')
// Base64 encoded of "username:password"
authToken = System.getProperty("authToken")
// 默认自动发布 AUTOMATIC
publishingType = 'USER_MANAGED'
}

publications {

mavenJava(MavenPublication) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_VERSION=3.5.8-SNAPSHOT
APP_VERSION=3.5.8-beta1
APP_GROUP=com.baomidou
signing.keyId=1FD337F9
signing.password=243194995
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.10"
classpath "io.freefair.gradle:lombok-plugin:8.6"
classpath "tech.yanand.maven-central-publish:tech.yanand.maven-central-publish.gradle.plugin:1.1.1"
}
}

Expand Down
2 changes: 1 addition & 1 deletion spring-boot-starter/build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tasks.matching { it.group == 'publishing' }.each { it.enabled = false }
tasks.matching {it.group == 'publishing' || it.group == 'central publish' }.each { it.enabled = false }

0 comments on commit cd4c856

Please sign in to comment.