From 1cb64551e1d46bedd54fcf21131b846528a8d053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Tegn=C3=A9r?= Date: Fri, 9 Oct 2020 10:47:12 +0200 Subject: [PATCH] Updated gradle script to include pom configuration required for maven central. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Tegnér --- build.gradle | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index eb4290b..0b4d10c 100644 --- a/build.gradle +++ b/build.gradle @@ -19,28 +19,29 @@ dependencies { } version = System.getenv("RELEASE_VERSION") ?: 'NONE' +group 'dev.personnummer' jar { manifest { attributes('Implementation-Title': project.name, - 'Implementation-Version': project.version) + 'Implementation-Version': project.version) } } -task javadocJar(type: Jar) { - archiveClassifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - archiveClassifier = 'sources' - from sourceSets.main.allSource +java { + withJavadocJar() + withSourcesJar() } artifacts { archives javadocJar, sourcesJar, jar } +javadoc { + if(JavaVersion.current().isJava9Compatible()) { + options.addBooleanOption('html5', true) + } +} test { useJUnitPlatform() @@ -80,13 +81,25 @@ publishing { from components.java pom { name = 'Personnummer' - description = '' + description = 'personnummer is a small open-source project that validates, formatting and determine sex and age from swedish personal identity numbers' url = 'https://personnummer.dev' licenses { license { name = 'MIT' + url = 'https://mit-license.org/' } } + developers { + developer { + id = 'jite' + name = 'Johannes Tegnér' + email = 'johannes@jitesoft.com' + } + } + scm { + connection = 'scm:git:git@github.com:personnummer/java.git' + url = 'https://github.com/personnummer/java' + } } } } @@ -101,5 +114,5 @@ signing { } tasks.withType(Sign) { - onlyIf { version != "NONE" } // so we can build jars for testing in CI + onlyIf { version != "NONE" } }