Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish sbt plugin to nexus repositories?

Tags:

sbt

nexus

I am new to sbt plugin publishing and I have just rewrote some features of an exist plugin. It has been working locally sine I ran publish-local on sbt console. Now, I want publish it to nexus repositories. Are there any good tutorial to do it?

like image 292
Jin Lin Avatar asked Aug 07 '14 21:08

Jin Lin


1 Answers

Right now, publishing sbt-plugins to nexus repos can cause some issues, but generally, this should apply: http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html

Additionally, you want to make sure in your plugin's build.sbt file:

sbtPlugin := true

publishMavenStyle := true.

There are a few issue currently:

  1. sbt-plugins are not legitimate maven artifacts, which is why most sbt plugins are published to "raw" repositories in this fashion: http://www.scala-sbt.org/0.13/docs/Bintray-For-Plugins.html
  2. Nexus, sometimes, will generate pom.xml files for ivy-deployed artifacts. This can seriously mess with sbt's resolution.

That said, a few users are, and have been, successfully deploying plugins to maven central or nexus repositories. We're actively working on sbt-ivy integration currently, so you will hopefully see more guidance in the nexus + sbt area soon.

like image 194
jsuereth Avatar answered Oct 02 '22 23:10

jsuereth