Przeglądaj źródła

发布中央仓库调整(不再支持SNAPSHOT发布).

nieqiurong 9 miesięcy temu
rodzic
commit
cd4c8563ba
4 zmienionych plików z 17 dodań i 12 usunięć
  1. 13 9
      build.gradle
  2. 1 1
      gradle.properties
  3. 2 1
      settings.gradle
  4. 1 1
      spring-boot-starter/build.gradle

+ 13 - 9
build.gradle

@@ -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}"
@@ -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) {

+ 1 - 1
gradle.properties

@@ -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

+ 2 - 1
settings.gradle

@@ -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"
     }
 }
 

+ 1 - 1
spring-boot-starter/build.gradle

@@ -1 +1 @@
-tasks.matching { it.group == 'publishing' }.each { it.enabled = false }
+tasks.matching {it.group == 'publishing' || it.group == 'central publish' }.each { it.enabled = false }