diff --git a/README.md b/README.md index c0639b3..77ea2dd 100644 --- a/README.md +++ b/README.md @@ -261,10 +261,30 @@ One of the inspirations for writing this library was to create a simple to use i * Before submitting a pull request run `./gradlew.bat clean check` and there are no errors. #### Building a release -* run `./gradlew bintrayUpload -Pversion=` -* sign in to https://bintray.com/jscancella/com.github.jscancella/bagging and publish the new version +Make sure you have setup your `gradle.properties` file and have distributed your gpg key +* install gnupg +* generate a key `gpg --full-generate-key` +* export your key `gpg --export-secret-keys -o C:\Users\John\secring.gpg` +* setup your `gradle.properties file` +``` +signing.keyId= +signing.password= +signing.secretKeyRingFile=C:\\Users\\John\\secring.gpg + +ossrhUsername= +ossrhPassword= +``` + +Now actually upload the new version +* run `./gradlew uploadArchives -Pversion=""` +* sign in to https://oss.sonatype.org/ +* The following is an abreviated version of https://central.sonatype.org/pages/releasing-the-deployment.html + * Go to the "staging repositories" (naviagation on the left) + * Find the artifact you just uploaded and click "close" button at the top of the page + * Allow time for nexus to go through its automated checking + * click "release" button at the top of page ## Roadmap for this library * Maintain interoperability with the [BagIt specification](https://tools.ietf.org/html/rfc8493). * Fix bugs/issues reported (on going). -* Translate to various languages (on going). +* Translate to various languages (on going). \ No newline at end of file diff --git a/bintray.gradle b/bintray.gradle deleted file mode 100644 index 91ee297..0000000 --- a/bintray.gradle +++ /dev/null @@ -1,106 +0,0 @@ -//This build file is for all the configuration specifics of building and deploying to jcenter (bintray) -apply plugin: "maven-publish" -apply plugin: "java-library" - -if(!project.hasProperty("bintrayUser")){ //so CI doesn't break - project.ext.bintrayUser = "foo" - project.ext.bintrayApiKey = "foo" -} - -if(!project.hasProperty("ossrhUsername")){ //so CI doesn't break - project.ext.ossrhUsername = "foo" - project.ext.ossrhPassword = "foo" -} - -task javadocJar(type: Jar) { - group "Build" - description "Create the jar that contains all the class documentation (javadoc)." - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - group "Build" - description "Create the jar that contains all the .class files." - classifier = 'sources' - from sourceSets.main.allSource -} - -bintray { - user = project.ext.bintrayUser - key = project.ext.bintrayApiKey - - publications = ['BagitPublication'] - - publish = false //Whether version should be auto published after an upload - - pkg { - repo = "com.github.jscancella" - name = "bagging" - userOrg = user - desc = "This is a software library intended to support the creation, manipulation, and validation of 'bags' from the bagit specification. It currently supports version 0.93 through 1.0." - websiteUrl = "https://github.com/jscancella/bagging" - issueTrackerUrl = "https://github.com/jscancella/bagging/issues" - licenses = ["AGPL-V3"] - vcsUrl = "https://github.com/jscancella/bagging" - labels = ["bagit", "bagging"] - publicDownloadNumbers = true - githubRepo = 'jscancella/bagging' - githubReleaseNotesFile = 'README.md' - - version{ - name = project.version - vcsTag = 'v' + project.version -// mavenCentralSync{ -// user = ossrhUsername -// password = ossrhPassword -// close = '0' //release the version manually on Maven Central -// } - } - } -} - -def pomConfig = { - licenses { - license { - name 'AGPL-V3' - url 'https://github.com/jscancella/bagging/blob/master/LICENSE.txt' - } - } - - developers { - developer { - id 'jscancella' - name 'John Scancella' - email 'john.scancella@gmail.com' - } - } - - scm { - connection 'scm:git:https://github.com/jscancella/bagging' - developerConnection 'scm:git:ssh://github.com/jscancella/bagging' - url 'https://github.com/jscancella/bagging' - } -} - -publishing { - publications { - BagitPublication(MavenPublication) { - from components.java - artifact sourcesJar //needed for syncing with maven central - artifact javadocJar //needed for syncing with maven central - - groupId 'com.github.jscancella' - artifactId 'bagging' - version project.version - - pom.withXml{ - def root = asNode() - root.appendNode('description', 'This is a software library intended to support the creation, manipulation, and validation of "bags" from the bagit specification. It currently supports version 0.93 through 1.0.') - root.appendNode('name', 'bagging') - root.appendNode('url', 'https://github.com/jscancella/bagging') - root.children().last() + pomConfig - } - } - } -} diff --git a/build.gradle b/build.gradle index 193b1c1..ed325d5 100644 --- a/build.gradle +++ b/build.gradle @@ -8,11 +8,10 @@ plugins { id "org.owasp.dependencycheck" version "5.3.2.1" id "org.ajoberstar.grgit" version "4.0.2" id "com.github.spotbugs" version "4.5.1" - id "com.jfrog.bintray" version "1.8.5" id 'info.solidsoft.pitest' version '1.5.2' } apply from: 'eclipse.gradle' -apply from: 'bintray.gradle' +apply from: 'maven-central.gradle' apply from: 'code-quality.gradle' apply from: 'message-bundle.gradle' @@ -27,13 +26,12 @@ if(project.version == "unspecified"){ } repositories { - jcenter() + mavenCentral() } dependencies { - implementation 'org.slf4j:slf4j-api:1.7.30' - //because they are exposed in the method call signature these should be API - api 'com.fasterxml.jackson.core:jackson-core:2.11.2', + implementation 'org.slf4j:slf4j-api:1.7.30', + 'com.fasterxml.jackson.core:jackson-core:2.11.2', 'com.fasterxml.jackson.core:jackson-databind:2.11.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2', diff --git a/maven-central.gradle b/maven-central.gradle new file mode 100644 index 0000000..7f16fae --- /dev/null +++ b/maven-central.gradle @@ -0,0 +1,73 @@ +apply plugin: 'maven' +apply plugin: 'signing' + +task javadocJar(type: Jar) { + group "Build" + description "Create the jar that contains all the class documentation (javadoc)." + classifier = 'javadoc' + from javadoc +} + +task sourcesJar(type: Jar) { + group "Build" + description "Create the jar that contains all the .class files." + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives sourcesJar, javadocJar +} + +signing { + sign configurations.archives +} + +group = 'com.github.jscancella' +archivesBaseName = 'bagging' +version = project.version + +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name 'bagging' + packaging 'jar' + // optionally artifactId can be defined here + description 'This is a software library intended to support the creation, manipulation, and validation of "bags" from the bagit specification. It currently supports version 0.93 through 1.0.' + url 'https://github.com/jscancella/bagging' + + scm { + connection 'scm:git:https://github.com/jscancella/bagging' + developerConnection 'scm:git:ssh://github.com/jscancella/bagging' + url 'https://github.com/jscancella/bagging' + } + + licenses { + license { + name 'AGPL-V3' + url 'https://github.com/jscancella/bagging/blob/master/LICENSE.txt' + } + } + + developers { + developer { + id 'blacksmithforlife' + name 'John Scancella' + email 'john.scancella@gmail.com' + } + } + } + } + } +} \ No newline at end of file