From 365af5981aa5d0e95882bf29432b31ac2e182134 Mon Sep 17 00:00:00 2001 From: Marcin Zajaczkowski Date: Wed, 2 Sep 2015 22:46:30 +0200 Subject: [PATCH 1/2] Simplify release mechanism --- build.gradle | 34 +---------------- gradle/release.gradle | 88 ++++++++++++++++--------------------------- 2 files changed, 34 insertions(+), 88 deletions(-) diff --git a/build.gradle b/build.gradle index 8b8d47bb77..7a0bace6ef 100644 --- a/build.gradle +++ b/build.gradle @@ -5,17 +5,12 @@ buildscript { } dependencies { classpath "pl.allegro.tech.build:axion-release-plugin:1.2.2" + classpath "com.bmuschko:gradle-nexus-plugin:2.3" classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3" } } apply plugin: "pl.allegro.tech.build.axion-release" -apply plugin: 'io.codearte.nexus-staging' - -nexusStaging { - packageGroup = "io.codearte" - stagingProfileId = '93c08fdebde1ff' -} scmVersion { tag { prefix = "accurest" } @@ -34,11 +29,7 @@ allprojects { subprojects { apply plugin: 'groovy' - apply plugin: 'maven-publish' - - if (!version.contains('SNAPSHOT')) { - apply from: "$rootDir/gradle/release.gradle" - } + apply from: "$rootDir/gradle/release.gradle" group = 'io.codearte.accurest' @@ -60,27 +51,6 @@ subprojects { exclude(group: 'org.codehaus.groovy') } } - - publishing { - publications { - maven(MavenPublication) { - from components.java - pom.withXml { - //#89 - workaround to not to have only runtime dependencies in generated pom.xml - //Known limitation in maven-publish - - http://forums.gradle.org/gradle/topics/maven_publish_plugin_generated_pom_making_dependency_scope_runtime#reply_14120711 - asNode().dependencies.'*'.findAll() { - it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep -> - dep.name == it.artifactId.text() - } - }.each() { - it.scope*.value = 'compile' - } - } - } - } - } - - uploadArchives.dependsOn { check } } project(':accurest-core') { diff --git a/gradle/release.gradle b/gradle/release.gradle index 34e8ae08ef..abe79f9d5e 100644 --- a/gradle/release.gradle +++ b/gradle/release.gradle @@ -1,64 +1,40 @@ -apply plugin: 'maven' -apply plugin: 'signing' +apply plugin: 'com.bmuschko.nexus' +apply plugin: 'io.codearte.nexus-staging' -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} +modifyPom { + project { + name "$project.name" + packaging 'jar' + description 'RESTful Contract Verifier' + url 'https://github.com/Codearte/accurest' + inceptionYear '2014' -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} + scm { + connection 'scm:git:git@github.com:Codearte/accurest.git' + developerConnection 'scm:git:git@github.com:Codearte/accurest.git' + url 'https://github.com/Codearte/accurest' + } -artifacts { - archives javadocJar, sourcesJar -} - -signing { - sign configurations.archives -} - -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: nexusUsername, password: nexusPassword) + licenses { + license { + name 'The Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' } + } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: nexusUsername, password: nexusPassword) - } - - pom.project { - name "$project.name" - packaging 'jar' - description 'RESTful Contract Verifier' - url 'http://codearte.github.io/accurest' - - scm { - connection 'scm:git:git@github.com:Codearte/accurest.git' - developerConnection 'scm:git:git@github.com:Codearte/accurest.git' - url 'https://github.com/Codearte/accurest' - } - - licenses { - license { - name 'The Apache License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - - developers { - developer { - id 'jkubrynski' - name 'Jakub Kubrynski' - email 'jk ATT codearte DOTT io' - } - } + developers { + developer { + id 'jkubrynski' + name 'Jakub Kubrynski' + email 'jk ATT codearte DOTT io' } } } -} \ No newline at end of file +} + +uploadArchives.dependsOn { check } + +nexusStaging { + packageGroup = "io.codearte" + stagingProfileId = '93c08fdebde1ff' +} From 0129666047b12e93b8c8f958a81a3625a1819e41 Mon Sep 17 00:00:00 2001 From: Marcin Zajaczkowski Date: Wed, 2 Sep 2015 22:49:40 +0200 Subject: [PATCH 2/2] Add marcingrzejszczak as a developer in pom.xml --- gradle/release.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gradle/release.gradle b/gradle/release.gradle index abe79f9d5e..8052622761 100644 --- a/gradle/release.gradle +++ b/gradle/release.gradle @@ -28,6 +28,11 @@ modifyPom { name 'Jakub Kubrynski' email 'jk ATT codearte DOTT io' } + developer { + id 'marcingrzejszczak' + name 'Marcin Grzejszczak' + email 'marcin ATT grzejszczak DOTT pl' + } } } }