I have an open source Scala project using SBT and I would like to release my library to Maven. How do I do it?
相关问题
- Unusual use of the new keyword
- Get Runtime Type picked by implicit evidence
- What's the point of nonfinal singleton objects
- PlayFramework: how to transform each element of a
- Error in Scala Compiler: java.lang.AssertionError:
相关文章
- IDEA2020 安装maven 插件后,springboot程序 SpringBootApplic
- pom文件中的插件定义
- pom.xml中的project为何报红
- Gatling拓展插件开发,check(bodyString.saveAs("key"))怎么实现
- RDF libraries for Scala [closed]
- Hibernate Tutorial - Where to put Mapping File?
- Why is my Dispatching on Actors scaled down in Akk
- How do you run cucumber with Scala 2.11 and sbt 0.
I always forget how to do this. So here are my notes:
Once in your life:
For every new developer machine:
Install
gpg
e.g. on OSX:brew install gpg
Run
gpg --gen-key
to generate a new key. Remember the passphrase and email you used.Make sure you see it when you list your secret keys:
Publish your key:
If this fails with
gpg: keyserver send failed: No route to host
, you may have to explicitly try with IPv4:Verify that key got published by searching gnupg.net or keyserver.net. This may take up to a day to show up
Add
default-key
to yourgpg.conf
:Append following to this file (
~/.sbt/${SBT_VERSION}/sonatype.sbt
):For each new project:
Create new JIRA issue using your Sonatype account to request new repo
Wait till above issue is resolved
Add
sbt-pgp
,sbt-release
andsbt-sonatype
as a plugin to your project. Here is an example plugins.sbt:Here is an example build.sbt that I use for multi-projects.
For each new release:
You may have to do
export GPG_TTY=$(tty)
to letgpg
do password prompt in command line like below:sbt +release
(will prompt for passphrase that you created forgpg
)+release
cross releases across your specifiedcrossScalaVersions
. If you havepushChanges
enabled in your build to push your commit to git remote, make sure you dopushChanges
once only on the lastcrossVersion
.View artifact on Sonatype (the snapshot versions are here)
Wait few hours for it to propagate to Maven Central
Starting Over