Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Included configuration to sign the POM and properly upload to staging…

… repo
  • Loading branch information...
commit 7bac6791c28ce6ef0829f1ada2da521617273271 1 parent 458e6b4
@tlberglund authored
Showing with 93 additions and 0 deletions.
  1. +2 −0  .gitignore
  2. +91 −0 build.gradle
View
2  .gitignore
@@ -9,3 +9,5 @@ database.properties
.settings/
.project
bin/
+maven-central.properties
+gradle.properties
View
91 build.gradle
@@ -1,10 +1,35 @@
apply plugin: 'groovy'
apply plugin: 'maven'
+apply plugin: 'signing'
+// Set Maven coordinates
version = '0.7'
group = 'com.augusttechgroup'
artifact = 'groovy-liquibase-dsl'
+// Get Maven Central credentials from properties file (not in version control)
+mavenCentralProps = new Properties()
+mavenCentralProps.load(new FileInputStream(file('maven-central.properties')))
+mavenCentralUsername = mavenCentralProps['maven.central.username']
+mavenCentralPassword = mavenCentralProps['maven.central.password']
+
+
+buildscript {
+ repositories {
+ mavenRepo name: "Gradle", urls: "http://repo.gradle.org/gradle/plugins-snapshots/"
+ }
+ dependencies {
+ classpath "org.gradle.plugins:gradle-signing-plugin:0.0.1-SNAPSHOT"
+ }
+}
+
+
+configurations {
+ deployment
+ meta
+ published.extendsFrom archives, meta
+}
+
repositories {
mavenCentral()
}
@@ -14,8 +39,74 @@ dependencies {
runtime 'org.codehaus.groovy:groovy:1.8.0'
testCompile 'junit:junit:4.7'
compile 'org.liquibase:liquibase-core:2.0.1'
+ deployment "org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-7"
}
jar {
baseName = artifact
}
+
+task sourceJar(type: Jar) {
+ description = 'An archive of the source code for Maven Central'
+ baseName = artifact
+ appendix = 'source'
+ from sourceSets.main.groovy
+}
+
+task groovydocJar(type: Jar, dependsOn: groovydoc) {
+ description = 'An archive of the GroovyDocs for Maven Central'
+ baseName = artifact
+ appendix = 'javadoc'
+ from fileTree(groovydoc.destinationDir)
+}
+
+signing {
+ sign configurations.archives, configurations.meta
+}
+
+artifacts {
+ meta groovydocJar, sourceJar
+}
+
+install {
+ repositories.mavenInstaller {
+ pom.project {
+ url('https://github.com/tlberglund/groovy-liquibase')
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+ developers {
+ developer {
+ id('tlberglund')
+ name('Tim Berglund')
+ email('tlberglund@gmail.com')
+ }
+ }
+ scm {
+ connection('scm:https://tlberglund@github.com/tlberglund/groovy-liquibase')
+ developerConnection('scm:git@github.com:tlberglund/groovy-liquibase.git')
+ url('https://github.com/tlberglund/groovy-liquibase')
+ }
+ }
+ }
+}
+
+
+uploadArchives {
+ repositories.mavenDeployer {
+ beforeDeployment { deployment ->
+ sign(deployment.pomArtifact)
+ }
+ name = 'mavenCentralReleaseDeployer'
+ configuration = configurations.published
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: mavenCentralUsername, password: mavenCentralPassword)
+ releases(updatePolicy: 'always')
+ snapshots(updatePolicy: 'never')
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.