There are different credentials for publishing vs. resolving.
I have published & resolved Maven artifacts with these settings:
In project/maven.sbt
:
addMavenResolverPlugin
In build.sbt
:
publishMavenStyle := true
Either in build.sbt
or ~/.sbt/0.13/credentials.sbt
:
// publish to bintray
credentials += Credentials("Bintray API Realm", "api.bintray.com", "<user>", "<bintray API key>")
// resolve from bintray
credentials += Credentials("Bintray", "dl.bintray.com", "<user>", "<bintray API key>")
To publish with sbt publish
, add this to build.sbt
:
publishTo := Some("<label>" at s"https://api.bintray.com/content/<user>/<organization>/<package>/${version.value}")
Remember that this only uploads the files to bintray.
Only you can resolve these files as long as you provide the credentials as shown above.
To resolve uploaded files (published or not), add this to build.sbt
:
resolvers += Resolver.bintrayRepo("<user>", "<organization>")
On Bintray, you have a time limit to decide whether to discard or publish uploaded package version files.
Resolver credentials are necessary under several conditions:
- the uploaded package version files have not yet been published
- the uploaded package version files have been published to a private repo
Resolver credentials are not necessary for published uploaded package version files.