فهرست منبع

发布中央仓库

nieqiurong 6 سال پیش
والد
کامیت
a30cfad6e1
2فایلهای تغییر یافته به همراه24 افزوده شده و 2 حذف شده
  1. 24 1
      build.gradle
  2. 0 1
      gradle.properties

+ 24 - 1
build.gradle

@@ -142,9 +142,32 @@ subprojects {
         }
     }
 
-
+    /*
+     * 1.修改 gradle.properties 中 signing.secretKeyRingFile的路径
+     * 2.执行 gradle clean build publish -Dun=用户名 -Dps=密码 -x test
+     * ---------------------------wrapper------------------------------------------
+     * win: gradlew.bat clean build publish -Dun=用户名 -Dps=密码 -x test
+     * mac: gradlew clean build publish -Dun=用户名 -Dps=密码 -x test
+     */
     publishing {
+
+        repositories {
+            maven {
+                def userName = System.getProperty("un")
+                def passWord = System.getProperty("ps")
+                def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
+                def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
+                url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+                credentials {
+                    username userName
+                    password passWord
+                }
+            }
+        }
+
         publications {
+
             mavenJava(MavenPublication) {
                 from components.java
 

+ 0 - 1
gradle.properties

@@ -1,4 +1,3 @@
 signing.keyId=1FD337F9
 signing.password=243194995
 signing.secretKeyRingFile=/Users/hubin/dev/signing.gpg
-local=true