sbt-plugin

Unresolved Dependencies sbt with play framework

南楼画角 提交于 2021-01-28 09:14:32
问题 As i am new to Stack Overflow please be patient i am working on a project with Play 2.5 exactly the starter example from the Website. As i have to work with ebean i followed the Steps of Setting ebean in the plugins.sbt as like addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.0") and also in my build.sbt file name := """play-java""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean) scalaVersion := "2.11.11" libraryDependencies +=

What's the relationship of the versions of scala when I use sbt to build a scala project?

a 夏天 提交于 2020-01-28 05:22:32
问题 I'm building a scala project(writen in scala 2.11) with SBT 1.x.There are a few "versions of scala" which made me puzzle. SBT 1.x => scala 2.12 SBT plugin => scala 2.x My project => scala 2.11 Please help me to figure out what's the difference or relationship between them.And how SBT tells them apart when compiling or running the project? 回答1: The Scala version used by sbt itself and its plugins is completely independent from the Scala version used to compile the code in your project. The sbt

What's the relationship of the versions of scala when I use sbt to build a scala project?

只谈情不闲聊 提交于 2020-01-28 05:21:28
问题 I'm building a scala project(writen in scala 2.11) with SBT 1.x.There are a few "versions of scala" which made me puzzle. SBT 1.x => scala 2.12 SBT plugin => scala 2.x My project => scala 2.11 Please help me to figure out what's the difference or relationship between them.And how SBT tells them apart when compiling or running the project? 回答1: The Scala version used by sbt itself and its plugins is completely independent from the Scala version used to compile the code in your project. The sbt

Unknown artifact sbtplugin Super safe compiler with scala 2.12

十年热恋 提交于 2020-01-24 05:47:14
问题 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 plugin.sbt : addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.2") the error showed by the Intellij import is: SBT project import [warn] [FAILED ] com.artima.supersafe#sbtplugin;1.1.2!sbtplugin.jar(src): (0ms) [warn] ==== typesafe-ivy-releases: tried [warn] https://repo.typesafe

onstart method of Global.java getting executed twice after upgrading playframework to 2.4.6

拟墨画扇 提交于 2019-12-25 09:29:35
问题 I have just upgraded my application from play framework 2.3.9 to 2.4.6. Everything is working fine, but onstart(Application app) method getting executed twice. As i have created some scheduler in the onstart method, they are also getting executed twice. Global.java public class Global extends GlobalSettings { public void onStart(Application app) { Logger.info("Application has started"); JPA.withTransaction(() -> { if (ConfigHelper.getGlobalValue("install").equalsIgnoreCase("xyz")) { Logger

How can I add a dependency to my sbt plugin?

两盒软妹~` 提交于 2019-12-24 12:51:26
问题 I would like to add a library that I am going to use within the code of my SBT-Plugin. I did ... sbtPlugin := true libraryDependencies += "..." %% "..." % "..." enablePlugins(SbtPlugin) scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value) } scriptedBufferLog := false ... in build.sbt located in the root of my plugin project. ▶ tree -L 1 . ├── README.md ├── build.sbt <- this one ├── project └── src But when I run the test, following: https:/

SBT plugin — execute custom task before compilation

依然范特西╮ 提交于 2019-12-24 04:21:57
问题 I've just written my first SBT Autoplugin which has a custom task that generates a settings file (if the file is not already present). Everything works as expected when the task is explicitly invoked, but I'd like to have it automatically invoked prior to compilation of the project using the plugin (without having the project modify it's build.sbt file). Is there a way of accomplishing this, or do I somehow need to override the compile command? If so, could anyone point me to examples of

How to make a SBT task depend on a module defined in the same SBT project?

ぐ巨炮叔叔 提交于 2019-12-22 18:36:21
问题 I have module A and module B in a multi-module SBT project. I want to write a resource generator task for module B that invokes code from module A. One way to do this is to pull all the code from module A under project/ but that is unfeasible as module A is massive and I would like to keep it where it is (see https://stackoverflow.com/a/47323703/471136). How do I do this in SBT? Secondly, is it possible to get rid of module B altogether i.e. I want the resource generator task for module A

accessing dependent (not child) projects in sbt plugin

帅比萌擦擦* 提交于 2019-12-12 06:07:21
问题 Please find below sample build.sbt file that uses our plugin. In this sample BasePlugin, we want to full path to a/project, b/project directory :- import sbt._ import Keys._ import BasePlugin._ BasePlugin.settings lazy val root = Project("root", file(".")).dependsOn( ProjectRef( uri("../some/where/a"), "a" ), ProjectRef( uri("../some/where/b"), "b" ) ) enablePlugins(BasePlugin) Also, find below, simplified sbt plugin BasePlugin.scala :- package base import sbt.{ThisBuild, Def, TaskKey,

How can a default task be overridden from an AutoPlugin?

浪尽此生 提交于 2019-12-10 17:56:44
问题 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: Seq[Def.Setting[_]] = Seq( packageBin in Compile <<= (packageBin in Compile).map { a => println("project/compile::packageBin") a } ) } But this does not work (at least not with SBT 0.13.5 and 0.13.6-M1), my version of packageBin gets never called. If I put