-
Notifications
You must be signed in to change notification settings - Fork 9
How to release with Sonatype
- Create a Sonatype Repository account
- Follow the instruction in the Central Repository documentation site.
If links are down, check the official instructions site here. It also has videos that explain the procedure.
The tutorial says that it can take up 2 business days. In my experience, it rarely takes more than one business day.
- Related articles on publishing to Sonatype (only read up if you cannot get it to work):
After you've created your sonatype account, go read the next steps in the You have a sonatype account section.
If you want to publish with Sonatype globally, first you need to configure the underlying publisher
that will be used by sbt-release-early
. Add the following line to your build.sbt
file:
releaseEarlyWith in Global := SonatypePublisher
(By default, releaseEarlyWith
defaults to BintrayPublisher
and is scoped in Global
.)
If you want a more fine-grained configuration, releasing to Sonatype only concrete modules, you
can scope the previous line to whichever project you want and it will work. But do make sure
to remove in Global
from the previous line line: releaseEarlyWith := SonatypePublisher
.
Check the tutorial in How to set up your CI.
You can depend immediately on a package that has been published to Sonatype by adding the Sonatype
staging repository either globally or in your project's build.sbt
:
resolvers += Resolver.sonatypeRepo("releases")
Make sure you scope this setting correctly. It's usually done globally (in Global
)if you don't
redefine resolvers
elsewhere. If you do, scope if at the place where the redefinition takes place.
There are two disadvantages of using Sonatype as your publisher.
- You do not have fine-grained control over organizations and rights like Bintray does.
- Publishing to Sonatype takes more time because it cannot be done in parallel, unlike Bintray:
If you'd like this to change, please give a thumbs up to each of those issues and let the maintainer know that this poses a problem to you. It does not end the world though. IMO, Sonatype is still superior than Bintray for most of the cases.
Read up on Bintray's disadvantages if you're interested to see how it fares.
This is a Scala Center project, originally created by jvican. It now powers the Scala Platform sbt plugin and several Scala Center projects. If you find it useful, give the Center a shout-out in our official Twitter account or let us know in our Gitter channel. Your feedback is important and motivates us to keep improving this plugin.