From 84be1b85bbd4bbb3b5068e0909ad4a4ccbc5e5a8 Mon Sep 17 00:00:00 2001
From: Jueun Park <s5616012@mailbox.tu-dresden.de>
Date: Fri, 18 Mar 2022 19:19:57 +0900
Subject: [PATCH] edited build.gradle and settings.gradle

---
 build.gradle    | 31 +++++++++++++++++++++++++++++++
 settings.gradle |  2 +-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 20e14f5c..be96394c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,6 +5,7 @@ apply plugin: 'java'
 apply plugin: 'jastadd'
 apply plugin: 'application'
 apply plugin: 'idea'
+apply plugin: 'maven-publish'
 
 mainClassName = 'de.tudresden.inf.st.openapi'
 
@@ -161,3 +162,33 @@ jastadd {
         delete "src/gen-res"
     }
 }
+
+publishing {
+    publications {
+        maven(MavenPublication) {
+            artifactId = 'test-rago'
+            // from components.java
+            artifact("build/libs/rago-${version}.jar") {
+                extension 'jar'
+            }
+        }
+    }
+    repositories {
+        maven {
+            url "https://git-st.inf.tu-dresden.de/api/v4/projects/$System.env.CI_PROJECT_ID/packages/maven"
+            // Uncomment the following lines to publish manually (and comment out the other credentials section)
+//            credentials(HttpHeaderCredentials) {
+//                name = "Private-Token"
+//                value = gitLabPrivateToken // the variable resides in ~/.gradle/gradle.properties
+//            }
+            credentials(HttpHeaderCredentials) {
+                name = 'Job-Token'
+                value = System.getenv("CI_JOB_TOKEN")
+            }
+            authentication {
+                header(HttpHeaderAuthentication)
+            }
+        }
+
+    }
+}
diff --git a/settings.gradle b/settings.gradle
index 18f4a228..e88ca10a 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,2 @@
-rootProject.name = 'jastadd-openapi'
+rootProject.name = 'jastadd-rago'
 
-- 
GitLab