diff --git a/build_publish.gradle b/build_publish.gradle index 5dccd17..1a04b02 100644 --- a/build_publish.gradle +++ b/build_publish.gradle @@ -1,5 +1,4 @@ // Documentation: https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle -// Secrets stored in ~/.jreleaser/config.toml apply plugin: 'maven-publish' apply plugin: 'signing' @@ -7,10 +6,9 @@ apply plugin: 'signing' publishing { repositories { maven { - //def snapshotsRepoUrl = 'http://oss.sonatype.org/content/repositories/snapshots/' - //def releaseRepoUrl = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/' - //url = project.hasProperty('release') ? releaseRepoUrl : snapshotsRepoUrl - url = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/' + def snapshotsRepoUrl = 'http://oss.sonatype.org/content/repositories/snapshots/' + def releaseRepoUrl = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/' + url = project.hasProperty('release') ? releaseRepoUrl : snapshotsRepoUrl if (project.hasProperty('mavenCentralUsername') && project.hasProperty('mavenCentralPassword')) { credentials { @@ -23,8 +21,6 @@ publishing { publications { mavenJava(MavenPublication) { - groupId = 'se.koc' - artifactId = 'zutil' from components.java pom { @@ -58,7 +54,8 @@ publishing { signing { required { hasProperty("signing.secretKeyRingFile") } - sign publishing.publications.mavenJava + //sign publishing.publications.mavenJava + sign configurations.archives } // Generate version.txt @@ -77,4 +74,20 @@ Build-time: ${java.time.LocalDateTime.now()} } } -sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt \ No newline at end of file +sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt + +// Generate additional Jars + +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} + +task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives javadocJar, sourcesJar +}