Skip to content

Instantly share code, notes, and snippets.

@martinbonnin
Created June 21, 2021 08:38
Show Gist options
  • Save martinbonnin/25883403509acbef066328f6a72fbd40 to your computer and use it in GitHub Desktop.
Save martinbonnin/25883403509acbef066328f6a72fbd40 to your computer and use it in GitHub Desktop.
publishing {
// Note the repositories block is inside the publishing block here
repositories {
maven {
// OSSStaging is where you upload to later release on MavenCentral
// (more on that later)
name = "OSSStaging"
// If you signed up on Sonatype recently, you might have a url like
// "https://s01.oss.sonatype.org/service/local/" instead
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("SONATYPE_NEXUS_USERNAME")
password = System.getenv("SONATYPE_NEXUS_PASSWORD")
}
}
maven {
// Sonatype also hosts SNAPSHOTs for you
// If you ever try to upload a SNPASHOT to OSSStaging, you will get an error
name = "OSSSnapshots"
// If you signed up on Sonatype recently, you might have a url like
// "https://s01.oss.sonatype.org/content/repositories/snapshots/" instead
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
credentials {
username = System.getenv("SONATYPE_NEXUS_USERNAME")
password = System.getenv("SONATYPE_NEXUS_PASSWORD")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment