diff --git a/.gitignore b/.gitignore
index 78aba4bb88ae15cc77fd1bb1b454f37c145e3839..9d1113344d54973e9d6b249c9c61bd3b3ce26c43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
 .idea/
 .gradle/
 build/
+/gradle.properties
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ae70e04bdbbce82230b935b51563abf2c6995734..97c262aeee33507b20f9521ecc819a02ac959312 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,7 @@ variables:
 
 stages:
 - build
+- publish
 - deploy
 
 before_script:
@@ -14,7 +15,7 @@ cache:
     - .gradle/caches
 
 build:
-  image: openjdk:8
+  image: openjdk:11
   stage: build
   script:
     - ./gradlew --console=plain --no-daemon assemble jar
@@ -22,6 +23,14 @@ build:
     paths:
       - "/builds/jastadd/ragconnect/build/libs/ragconnect-*.jar"
 
+publish:
+  image: openjdk:11
+  stage: publish
+  script:
+    - "./gradlew publish"
+#  only:
+#    - master
+
 pages:
   image: python:3.7-alpine
   stage: deploy
diff --git a/ragconnect.base/build.gradle b/ragconnect.base/build.gradle
index 153a3be2b1c37d31784bc0d4075b77a53b4f0a87..e03dfa4ef7c4cfcbf68a38b8da5005ca51b30621 100644
--- a/ragconnect.base/build.gradle
+++ b/ragconnect.base/build.gradle
@@ -2,6 +2,7 @@ apply plugin: 'java-library'
 apply plugin: 'idea'
 apply plugin: 'jastadd'
 apply plugin: 'application'
+apply plugin: 'maven-publish'
 
 group = 'de.tudresden.inf.st'
 
@@ -178,3 +179,44 @@ jastadd {
 }
 
 generateAst.dependsOn relast
+
+//708
+publishing {
+    publications {
+        maven(MavenPublication) {
+            artifactId = 'ragconnect'
+            from components.java
+//            artifact("build/libs/ragconnect-${version}.jar") {
+//                extension 'jar'
+//            }
+        }
+    }
+    repositories {
+//        maven {
+//            name 'nexus'
+//            url "http://172.22.1.152:8081/repository/" + (project.hasProperty('asSnapshot') ? "maven-snapshots" : "maven-releases/")
+//            credentials {
+//                username project.ext.properties.repoUser
+//                password project.ext.properties.repoPassword
+//            }
+//        }
+        maven {
+            url "https://git-st.inf.tu-dresden.de/api/v4/projects/708/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)
+            }
+        }
+
+    }
+}
+
+publish.dependsOn jar