Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Changes to Publish to Maven Central #3

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.gradle
.idea
gradle
gradle.properties

# Ignore Gradle build output directory
build
Expand Down
55 changes: 50 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
Expand All @@ -19,7 +20,7 @@ repositories {
mavenCentral()
}

group = 'software.amazon.nio.s3'
group = 'com.sigpwned'
archivesBaseName = 'nio-spi-for-s3'
version = '1.1.0'

Expand Down Expand Up @@ -55,22 +56,52 @@ dependencies {

publishing {
publications {
s3fsSpiLibrary(MavenPublication) {
maven(MavenPublication) {
from components.java
pom {
name = 'AWS Java NIO SPI for S3'
description = 'A Java NIO.2 service provider for S3, allowing Java NIO operations to be performed on paths using the `s3` scheme. This\n' +
'package implements the service provider interface (SPI) defined for Java NIO.2 in JDK 1.7 providing "plug-in" non-blocking\n' +
'access to S3 objects for Java applications using Java NIO.2 for file access.'
url = 'https://github.com/awslabs/aws-java-nio-spi-for-s3'
url = 'https://github.com/sigpwned/aws-java-nio-spi-for-s3'
inceptionYear = '2022'

scm {
url = 'https://github.com/sigpwned/aws-java-nio-spi-for-s3/tree/main'
connection = 'scm:git:ssh://[email protected]/sigpwned/aws-java-nio-spi-for-s3.git'
developerConnection = 'scm:git:ssh://[email protected]/sigpwned/aws-java-nio-spi-for-s3.git'
}

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
name = 'Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}

developers {
developer {
id = 'markjschreiber'
name = 'Mark Schreiber'
email = '[email protected]'
}
developer {
id = 'sigpwned'
name = 'Andy Boothe'
email = '[email protected]'
}
}
}
}
}

repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials(PasswordCredentials)
}
}
}
Expand All @@ -86,3 +117,17 @@ jacocoTestReport {
xml.outputLocation = file("build/reports/coverage.xml")
}
}

signing {
sign publishing.publications.maven
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}




9 changes: 9 additions & 0 deletions gradle.properties.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Probably a usertoken from Maven Central
mavenUsername=<MAVEN CENTRAL USERNAME GOES HERE>
mavenPassword=<MAVEN CENTRAL PASSWORD GOES HERE>

signing.keyId=<KEY ID GOES HERE>
signing.password=<KEY PASSWORD GOES HERE>
# Generated using: $ gpg --keyring secring.gpg --export-secret-keys > /path/to/home/.gnupg/secring.gpg
signing.secretKeyRingFile=/path/to/home/.gnupg/secring.gpg

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists