Skip to content

Commit

Permalink
chore: fix publishing Gradle plugin to Maven Central #1588
Browse files Browse the repository at this point in the history
  • Loading branch information
uglyog committed Aug 30, 2022
1 parent 5cc2bdb commit 6720459
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
54 changes: 54 additions & 0 deletions provider/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,57 @@ compileGroovy {
dependsOn compileKotlin
classpath = classpath.plus(files(compileKotlin.destinationDir))
}

publishing {
publications {
pluginMaven(MavenPublication) {
// from components.java

pom {
name = project.name
description = 'Gradle Pact plugin'
url = 'https://github.com/pact-foundation/pact-jvm'
licenses {
license {
name = 'Apache 2'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/pact-foundation/pact-jvm'
connection = 'https://github.com/pact-foundation/pact-jvm.git'
}

developers {
developer {
id = 'thetrav'
name = 'Travis Dixon'
email = '[email protected]'
}
developer {
id = 'rholshausen'
name = 'Ronald Holshausen'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
if (project.hasProperty('sonatypeUsername')) {
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
}

signing {
required { project.hasProperty('isRelease') }
sign publishing.publications.pluginMaven
}
5 changes: 3 additions & 2 deletions releasePrep.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ ask('Tag and Push commits?: [Y]') {
}

ask('Publish artifacts to maven central?: [Y]') {
executeOnShell './gradlew clean publish -S -x :pact-publish:publish -PisRelease=true'
executeOnShell './gradlew clean publish -S -x :pact-publish:publish -x :provider:gradle:publish -PisRelease=true'
executeOnShell './gradlew :provider:gradle:publishPluginMavenPublicationToMavenRepository -PisRelease=true'
}

ask('Publish Gradle plugin?: [Y]') {
executeOnShell './gradlew :provider:gradle:publishPlugins -S -PisGradleRelease=true'
executeOnShell './gradlew :provider:gradle:publishPlugins -PisRelease=true'
}

ask('Publish pacts to pact-foundation.pactflow.io?: [Y]') {
Expand Down

0 comments on commit 6720459

Please sign in to comment.