From bdeb99d0508e65e86fb2a7e717a1fbf5fd714e54 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Sun, 19 Jan 2020 15:42:30 +0100 Subject: [PATCH] Add maven support --- build.gradle | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f59f3e9..5018474 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,19 @@ plugins { id 'java' + id 'maven-publish' +} + +def getVersionName = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags' + standardOutput = stdout + } + return stdout.toString().trim() } group 'ley' -version '1.0-SNAPSHOT' - +version getVersionName() sourceCompatibility = 1.8 repositories { @@ -20,3 +29,24 @@ task sourcesJar(type: Jar) { from sourceSets.main.allJava } +publishing { + publications { + maven(MavenPublication) { + groupId = project.group + artifactId = project.name + version = project.version + from components.java + } + } + + repositories { + maven { + credentials { + username = "$usr" + password = "$pwd" + } + + url = "http://git.tilera.xyz:8002/repository/maven-releases/" + } + } +}