Questions tagged [sbt-plugin]

A plugin extends the build definition, most commonly by adding new settings. The new settings could be new tasks. For example, a plugin could add a codeCoverage task which would generate a test coverage report.

An SBT plugin extends the build definition, most commonly by adding new settings. The new settings could be new tasks. For example, a plugin could add a codeCoverage task which would generate a test coverage report.

192 questions
5
votes
1 answer

SBT Plugin: How to add compiler plugin as a dependency that is not propagated downstream?

I'm writing a SBT plugin. I would like to use Circe JSON library, but it requires the Macro Paradise compiler plugin on Scala 2.10. Normally you add compiler plugins to build.sbt and SBT plugins to project/plugins.sbt. Now when you're building a SBT…
mirosval
  • 6,671
  • 3
  • 32
  • 46
5
votes
2 answers

SBT Plugin in an unmanaged jar file

The requirement: an SBT plugin code is in an unmanaged jar, for example in lib/unmanaged-sbt-plugin-0.0.1.jar. I was expecting the jar file would be picked up by SBT automatically and the plugin would work out-of-the-box, i.e.: the tasks would be…
sshmsh
  • 181
  • 10
5
votes
0 answers

How to have sbt plugin exclude its dependency?

After banging my head against https://github.com/google/guice/issues/846 for over an hour, I realized that I have the Guice library provided by two different jars: guice-4.0-beta5.jar and sisu-guice-3.1.3-no_aop.jar. Gaahh... The second one is…
Paul Draper
  • 78,542
  • 46
  • 206
  • 285
4
votes
0 answers

sbt assembly assemblyShadeRules not shading dependency

I am trying to shade com.google.gson to my_gson and added assemblyShadeRules to my build.sbt: assemblyShadeRules in assembly ++= Seq( ShadeRule.rename("com.google.gson.**" -> "my_gson.@1") .inLibrary("com.google.code.gson" % "gson" % "2.8.9") …
stephen
  • 51
  • 2
4
votes
1 answer

sbt release to Maven central fails with no public key error

I tried to release better-files to Maven central and I am getting this error. I tried this on fresh checkout on multiple different machines. My steps: Step 1: Generate keys > sbt sbt:better-files-root> pgp-cmd gen-key Please enter the name…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
4
votes
2 answers

Multiple main classes with SBT assembly

I'm looking to create jars for AWS Lambda to run job tasks. Currently my build.sbt file looks something like this: lazy val commonSettings = Seq(...) lazy val core = project .settings(commonSettings: _*) lazy val job = project …
Andreas Jarbol
  • 745
  • 2
  • 11
  • 27
4
votes
1 answer

Unknown artifact sbtplugin Super safe compiler with scala 2.12

In my sbt project in Scala 2.12 I am using IntelliJ IDEA and want to import scalatest. In order to install the recommended SuperSafe Community Edition Scala compiler plugin. I followed the instruction here. My…
salvob
  • 1,300
  • 3
  • 21
  • 41
4
votes
1 answer

How to configure sonatype nexus to allow sbt plugins?

When publishing our plugin we got this [info] Done packaging. [trace] Stack trace suppressed: run last *:publish for the full output. [error] (*:publish) java.io.IOException: PUT operation to URL…
Somatik
  • 4,723
  • 3
  • 37
  • 49
4
votes
2 answers

Is it possible to reject publish if SNAPSHOT dependencies are used in SBT?

I keep accidentally publishing my internal project still referencing internal SNAPSHOTs, but it would be very helpful if there was an SBT plugin that would fail to publish if you are relying on any SNAPSHOT dependencies. Is anyone aware of such a…
darkfrog
  • 1,053
  • 8
  • 29
4
votes
0 answers

SBT plugin how to make a source generator dependent on project's sources?

I'm trying to create a source generator in a SBT plugin that generate code based on the project's sources. I tried something like this: sourceGenerators in Compile += (sources in Compile) map { sources => doSomethingWithSources(sources)…
4
votes
1 answer

How to import sbt pack plugin to project

I follow the sbt-pack link to import the plugin. I did: add a line addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.7.5") to plugins.sbt under my project root directory. add a line packAutoSettings to the very top of build.sbt file under project…
qqibrow
  • 2,942
  • 1
  • 24
  • 40
4
votes
2 answers

How can a default task be overridden from an AutoPlugin?

Let's say that I wan to override (replace) the default setting for the packageBin task. So I naively wrote an AutoPlugin like this: object TestPlugin extends AutoPlugin { override def trigger = allRequirements override val projectSettings:…
user1752169
  • 383
  • 2
  • 7
4
votes
1 answer

Sbt Plugin Add Dependency to project/build.sbt

I have an sbt-plugin that when enabled adds a scalac compiler plugin via scalac options. All is fine with that. However if the scalac compiler plugin itself has a dependency it needs to use, I cannot get this to work. I've tried: adding the…
sksamuel
  • 16,154
  • 8
  • 60
  • 108
3
votes
1 answer

Include scala source files in sbt pack output jar

How can the scala source files of a project be included in the generated target jar produced by sbt pack? Currently, when an IDE user of my jar tries to jump to a function in the library they will only get decompiled version of the code instead of…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
3
votes
1 answer

SBT always downloads the packages/scala libraries on Docker, docker-compose

I have recently installed SBT on Docker Ubuntu machine to get started with Scala. When I started docker initially, it started grabbing all the Java, sbt JAR's from the remote locations…
Bunlong
  • 652
  • 1
  • 9
  • 21
1
2
3
12 13