From f55e855769ec9c0d7c53fb68cadb2904b3580180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Thu, 25 Apr 2019 09:58:44 +0200 Subject: [PATCH] Deploy also to Gradle plugin portal (#629) (#1050) --- .../build.gradle | 5 +++++ .../gradle/release.gradle | 21 +++++++++++++++++++ ....springframework.cloud.contract.properties | 16 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.cloud.contract.properties diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle index 3dca4f934d..ed56730aa4 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle @@ -8,10 +8,15 @@ buildscript { if (project.hasProperty('fatJar')) { jcenter() } + //For plugin-publish-plugin. Could be limited only to that dependency with Gradle 5.1+ - https://docs.gradle.org/5.1.1/release-notes.html#repository-to-dependency-matching + maven { + url 'https://plugins.gradle.org/m2/' + } } dependencies { classpath "com.bmuschko:gradle-nexus-plugin:2.3" classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3" + classpath 'com.gradle.publish:plugin-publish-plugin:0.9.10' if (project.hasProperty('fatJar')) { classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' } diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/release.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/release.gradle index efe6edc56b..23ff0cdfda 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/release.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/release.gradle @@ -56,6 +56,27 @@ if (isReleaseToCentral) { signing { sign configurations.archives } + + apply plugin: 'com.gradle.plugin-publish' + + pluginBundle { + website = 'https://github.com/spring-cloud/spring-cloud-contract' + vcsUrl = 'https://github.com/spring-cloud/spring-cloud-contract' + + plugins { + plugin { + id = 'org.springframework.cloud.contract' + displayName = 'spring-cloud-contract' + description = 'Spring Cloud Contract Gradle Plugin' + tags = ['spring', 'spring-framework', 'spring-cloud', 'spring-cloud-contract'] + } + } + + mavenCoordinates { + groupId = project.group + artifactId = project.name + } + } } afterEvaluate { diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.cloud.contract.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.cloud.contract.properties new file mode 100644 index 0000000000..1f486833f9 --- /dev/null +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.cloud.contract.properties @@ -0,0 +1,16 @@ +# +# Copyright 2013-2019 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +implementation-class=org.springframework.cloud.contract.verifier.plugin.SpringCloudContractVerifierGradlePlugin