diff --git a/build.gradle b/build.gradle index bf15c5c9a6..2d9d798003 100644 --- a/build.gradle +++ b/build.gradle @@ -146,8 +146,10 @@ subprojects { publications { mavenPublication(MavenPublication) { from components.java - artifact sourceJar - artifact javadocJar + if (!project.hasProperty('isGradleRelease')) { + artifact sourceJar + artifact javadocJar + } pom { name = project.name description = StringEscapeUtils.escapeXml11(new File(projectDir, 'README.md').text) diff --git a/provider/gradle/README.md b/provider/gradle/README.md index 7a803fade5..363fa4a6c5 100644 --- a/provider/gradle/README.md +++ b/provider/gradle/README.md @@ -693,11 +693,7 @@ pact { } ``` -**NOTE: Currently the pacts are fetched from the broker during the configuration phase of the build. This means that -if the broker is not available, you will not be able to run any Gradle tasks.** This should be fixed in a forth coming -release. - -In the mean time, to only load the pacts when running the validate task, you can do something like: +To only load the pacts when running the validate task, you can do something like: ```groovy pact { diff --git a/provider/gradle/src/main/kotlin/au/com/dius/pact/provider/gradle/GradleProviderInfo.kt b/provider/gradle/src/main/kotlin/au/com/dius/pact/provider/gradle/GradleProviderInfo.kt index b5a8df7f87..9dcaf9affa 100644 --- a/provider/gradle/src/main/kotlin/au/com/dius/pact/provider/gradle/GradleProviderInfo.kt +++ b/provider/gradle/src/main/kotlin/au/com/dius/pact/provider/gradle/GradleProviderInfo.kt @@ -85,8 +85,9 @@ open class GradleProviderInfo(override var name: String, val project: Project) : return fromPactBroker } + @JvmOverloads @Deprecated(message = "hasPactsFromPactBroker has been deprecated in favor of fromPactBroker") - fun hasPactsFromPactBroker(options: Map, pactBrokerUrl: String): List { + fun hasPactsFromPactBroker(options: Map = mapOf(), pactBrokerUrl: String): List { return try { provider.hasPactsFromPactBroker(options, pactBrokerUrl) } catch (e: Exception) { @@ -118,9 +119,10 @@ open class GradleProviderInfo(override var name: String, val project: Project) : return fromPactBroker } + @JvmOverloads @Deprecated(message = "hasPactsFromPactBroker has been deprecated in favor of fromPactBroker") fun hasPactsFromPactBrokerWithSelectors( - options: Map, + options: Map = mapOf(), pactBrokerUrl: String, selectors: List ): List { @@ -177,7 +179,7 @@ open class GradleProviderInfo(override var name: String, val project: Project) : |For instance: | |fromPactBroker { - | selectors = latestTags('test') + | withSelectors { latestTag('test') } | enablePending = true | providerTags = ['master'] |}