Skip to content

Commit

Permalink
Updated gradle script to include pom configuration required for maven…
Browse files Browse the repository at this point in the history
… central.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
  • Loading branch information
Johannestegner committed Oct 9, 2020
1 parent 431bf8a commit 1cb6455
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'
}
}
}
}
Expand All @@ -101,5 +114,5 @@ signing {
}

tasks.withType(Sign) {
onlyIf { version != "NONE" } // so we can build jars for testing in CI
onlyIf { version != "NONE" }
}

0 comments on commit 1cb6455

Please sign in to comment.