add common
authorTang Cheng <cheng.tang@supwisdom.com>
Wed, 10 Jul 2019 01:30:23 +0000 (09:30 +0800)
committerTang Cheng <cheng.tang@supwisdom.com>
Wed, 10 Jul 2019 01:32:48 +0000 (09:32 +0800)
Makefile
common/build.gradle

index 475a4a0..24ba11e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,4 +15,4 @@ push: docker
        docker push harbor.supwisdom.com/dali/payapi
 
 publish: build
-       $(GRADLE) payapi-sdk:publish
+       $(GRADLE) publish
index dcfba9e..e3e1704 100644 (file)
@@ -1,5 +1,33 @@
 plugins {
-    id 'java'
+    id 'java-library'
+    id 'maven-publish'
+    id "com.palantir.git-version" version "0.12.0-rc2"
+}
+
+group = rootProject.group
+version = gitVersion()
+
+publishing {
+    publications {
+        mavenJava(MavenPublication) {
+            groupId = project.group
+            artifactId = project.name
+            version = version
+            from components.java
+        }
+    }
+    repositories {
+        maven {
+            // change URLs to point to your repos, e.g. http://my.org/repo
+            def releasesRepoUrl = "http://ykt-nx.supwisdom.com/repository/ecard-repo/"
+            def snapshotsRepoUrl = "http://ykt-nx.supwisdom.com/repository/ecard-repo/snapshot/"
+            url = version.endsWith('dirty') ? snapshotsRepoUrl : releasesRepoUrl
+            credentials(PasswordCredentials) {
+                username = nxUser
+                password = nxPassword
+            }
+        }
+    }
 }
 
 dependencies {