2

I have a CLI app which compile only to 2.11 (because of some internal dependency).

I want to package this app as a sbt plugin. This sbt plugin run the app by forking the JVM, running separately with its own classpath to avoid Scala library conflict.

Obviously I need to download the scala 2.11 app with all its dependencies and I am using a custom Configuration for it. My issue is that when I try to list the dependencies it comes with the scala library configured by the project.

Specific code is here : https://github.com/thibaultdelor/CliAppSbtPlugin/blob/master/plugin/src/main/scala/com/thibaultdelor/MyWrapperPlugin.scala#L33

    autoScalaLibrary in CliConfig := false,
    libraryDependencies ++= Seq(
      "org.scala-lang"   % "scala-library"             % "2.11.12"     % CliConfig,
      "com.thibaultdelor" % "mycli_2.11" %  "0.0.1" % CliConfig
    )

    val dependencies = (update in CliConfig).value.select(configurationFilter(CliConfig.name))

Here, if the project has the scala version 2.12, dependencies will contains scala-library 2.12 instead of what 2.11 as I would like.

Any help welcome, I am stuck. The sample project is on github and has a failing test case for it.

tibo
  • 5,326
  • 4
  • 37
  • 53

0 Answers0